                 codeKeys[index] = cp1
                 nameVals[index] = name
 
-                if (cp2 != empty) {
-                    var s = String()
-                    s.append(Character(UnicodeScalar(cp1)!))
-                    s.append(Character(UnicodeScalar(cp2)!))
-                    multipoints[name] = s
-                }
-                i = i + 1
+                if cp2 != empty {
+                    var string = String()
+                    string.append(Character(UnicodeScalar(cp1)!))
+                    string.append(Character(UnicodeScalar(cp2)!))
+                    multipoints[name] = string
+                }
+                i += 1
             }
         }
 

     */
    open static func getByName(name: String) -> String {
        let val = multipoints[name]
        if (val != nil) {return val!}
        let codepoint = EscapeMode.extended.codepointForName(name)
        if (codepoint != empty) {
            return String(Character(UnicodeScalar(codepoint)!))
        }
        return emptyName


        public func nameForCodepoint(_ codepoint: Int ) -> String {
            //let ss = codeKeys.index(of: codepoint)
            
            guard let  index = codeKeys.index(of: codepoint) else{
                return emptyName
            }
            // the results are ordered so lower case versions of same codepoint come after uppercase,
            // and we prefer to emit lower
            // (and binary search for same item with multi results is undefined
            return (index < nameVals.count-1 && codeKeys[index+1] == codepoint) ?
                nameVals[index+1] : nameVals[index]
        }

        private func size() -> Int {
