public static CharsRef join(String[] words, CharsRefBuilder reuse) {int upto = 0;char[] buffer = reuse.chars();for (String word : words) {final int wordLen = word.length();final int needed = (0 == upto ? wordLen : 1 + upto + wordLen); if (needed > buffer.length) {reuse.grow(needed);buffer = reuse.chars();}if (upto > 0) {buffer[upto++] = SynonymMap.WORD_SEPARATOR;}word.getChars(0, wordLen, buffer, upto);upto += wordLen;}reuse.setLength(upto);return reuse.get();}
public static CharsRef Join(string[] words, CharsRef reuse){int upto = 0;char[] buffer = reuse.Chars;foreach (string word in words){int wordLen = word.Length;int needed = (0 == upto ? wordLen : 1 + upto + wordLen); if (needed > buffer.Length){reuse.Grow(needed);buffer = reuse.Chars;}if (upto > 0){buffer[upto++] = SynonymMap.WORD_SEPARATOR;}word.CopyTo(0, buffer, upto, wordLen - 0);upto += wordLen;}reuse.Length = upto;return reuse;}