contrib & examples..: update users of `join("")`
authorAlexis Laferrière <alexis.laf@xymus.net>
Fri, 17 Jul 2015 14:01:23 +0000 (10:01 -0400)
committerAlexis Laferrière <alexis.laf@xymus.net>
Sat, 18 Jul 2015 13:46:22 +0000 (09:46 -0400)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

contrib/jwrapper/src/code_generator.nit
contrib/jwrapper/src/model.nit
contrib/neo_doxygen/src/model/linked_text.nit
contrib/pep8analysis/src/cfg/dot_printer.nit
examples/rosettacode/balanced_brackets.nit
examples/rosettacode/one_dimensional_cellular_automata.nit
lib/dom/xml_entities.nit
src/ffi/java.nit
tests/example_string.nit

index ee0942f..88a8f86 100644 (file)
@@ -84,10 +84,10 @@ class CodeGenerator
                if module_name != null then file_out.write "module {module_name}\n"
 
                file_out.write("\n")
-               file_out.write(imports.join(""))
+               file_out.write(imports.join)
                file_out.write("\n")
-               file_out.write(class_content.join(""))
-               file_out.write(wrappers.join(""))
+               file_out.write(class_content.join)
+               file_out.write(wrappers.join)
        end
 
        fun gen_licence: String
@@ -117,7 +117,7 @@ class CodeGenerator
                temp.add("extern class Native{jtype.id} in \"Java\" `\{ {jtype} `\}\n")
                temp.add("\tsuper JavaObject\n\n")
 
-               return temp.join("")
+               return temp.join
        end
 
        fun gen_unknown_class_header(jtype: JavaType): String
@@ -133,7 +133,7 @@ class CodeGenerator
                temp.add("extern class {nit_type} in \"Java\" `\{ {jtype.to_package_name} `\}\n")
                temp.add("\tsuper JavaObject\n\nend\n")
 
-               return temp.join("")
+               return temp.join
        end
 
        fun gen_attribute(jid: String, jtype: JavaType): String
@@ -219,7 +219,7 @@ class CodeGenerator
 
                var temp = new Array[String]
 
-               temp.add(comment + nit_signature.join(""))
+               temp.add(comment + nit_signature.join)
 
                # FIXME : This huge `if` block is only necessary to copy primitive arrays as long as there's no better way to do it
                if comment == "#" then
@@ -235,7 +235,7 @@ class CodeGenerator
                        temp.add(" in \"Java\" `\{\n{comment}\t\tself.{jmethod_id}({java_params});\n{comment}\t`\}\n")
                end
 
-               return temp.join("")
+               return temp.join
        end
 end
 
index d38a7a1..422c051 100644 (file)
@@ -94,9 +94,9 @@ class JavaType
                var name
                if is_primitive_array then
                        # Primitive arrays have a special naming convention
-                       name = "Native" + extern_class_name.join("").capitalized + "Array"
+                       name = "Native" + extern_class_name.join.capitalized + "Array"
                else
-                       name = "Native" + extern_class_name.join("")
+                       name = "Native" + extern_class_name.join
                end
 
                var nit_type = new NitType(name)
index bfdf6a5..83fa3b8 100644 (file)
@@ -112,7 +112,7 @@ abstract class LinkedText
                var text = self["text"]
 
                if text isa JsonArray then
-                       return text.join("")
+                       return text.join
                else
                        return "UNDEFINED"
                end
index 0bf39c0..116c91c 100644 (file)
@@ -23,7 +23,7 @@ redef class BasicBlock
        do
                var code_lines = new Array[String]
                for line in lines do code_lines.add(line.text)
-               var code = code_lines.join("")
+               var code = code_lines.join
 
                code = code.replace("\n","\\l").replace("\"","\\\"").replace("\\n","|n").replace("/","\\/").replace("\r","")
                # the last one is a hack
index a1ae476..acf50a0 100644 (file)
@@ -34,6 +34,6 @@ if args.not_empty then n = args.first.to_i
 for i in [0..10[ do
        var a = (['[', ']'] * n)
        a.shuffle
-       var b = a.join("")
+       var b = a.join
        if is_balanced(b) then print "{b} is well-balanced" else print "{b} is not well-balanced"
 end
index 77b2ed2..fd3ead4 100644 (file)
@@ -33,7 +33,7 @@ end
 
 var ary = "_###_##_#_#_#_#__#__".chars
 loop
-       print ary.join("")
+       print ary.join
        var nxt = evolve(ary)
        if ary == nxt then break
        ary = nxt
index ef080d4..9e6c8bc 100644 (file)
@@ -129,7 +129,7 @@ end
 class XMLDocument
        super XMLEntity
 
-       redef fun to_s do return children.join("")
+       redef fun to_s do return children.join
 end
 
 # PCDATA is any kind of non-xml formatted text
index c26fea2..74d421e 100644 (file)
@@ -606,7 +606,7 @@ redef class MMethod
                        else format.add "V"
                end
 
-               return format.join("")
+               return format.join
        end
 
        # Similar to `build_c_signature` but adapted to create the signature expected by JNI for C functions
index 106e498..1264a67 100644 (file)
@@ -49,4 +49,4 @@ printn("The value of a is: " + a.to_s + ".\n")
 # Fiveth way: Join arrays.
 # Pro: Sometime efficient on complex concatenation.
 # Con: Crazy.
-printn(["The value of a is: ", a.to_s, ".\n"].join(""))
+printn(["The value of a is: ", a.to_s, ".\n"].join)