lib/core/stream: LineIterator use CachedIterator
[nit.git] / benchmarks / strings / array_to_s_vars / array_to_s_manual.nit
index da6b667..0a79d35 100644 (file)
@@ -13,7 +13,7 @@
 # To be used as a Mixin at compile-time for benchmarking purposes.
 module array_to_s_manual
 
-intrude import standard::string
+intrude import standard::text::flat
 intrude import standard::collection::array
 
 redef class NativeArray[E]
@@ -33,7 +33,7 @@ redef class Array[E]
                        na[i] = tmp
                        i += 1
                end
-               var ns = new NativeString(sl + 1)
+               var ns = new CString(sl + 1)
                ns[sl] = '\0'
                i = 0
                var off = 0
@@ -52,6 +52,6 @@ redef class Array[E]
                        end
                        i += 1
                end
-               return ns.to_s_with_length(sl)
+               return ns.to_s_unsafe(sl, copy=false)
        end
 end