stdlib/strings: Minor style fix
[nit.git] / lib / standard / string.nit
index b34e043..aa3cef5 100644 (file)
@@ -1012,6 +1012,12 @@ abstract class Buffer
        # Adds the content of text `s` at the end of self
        fun append(s: Text) is abstract
 
+       redef fun hash
+       do
+               if is_dirty then hash_cache = null
+               return super
+       end
+
 end
 
 # Mutable strings of characters.
@@ -1083,10 +1089,7 @@ class FlatBuffer
        end
 
        # Create a new empty string.
-       init
-       do
-               with_capacity(5)
-       end
+       init do with_capacity(5)
 
        init from(s: Text)
        do