Skip to content

Commit

Permalink
remove extra returns and conditional compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
mandel59 committed Jul 13, 2014
1 parent 91c1daf commit 14c797d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions unifill/Utf16.hx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class Utf16 implements Utf {
**/
public static inline function fromCodePoint(codePoint : Int) : Utf16 {
var buf = new StringU16Buffer();
Utf16Impl.encode_code_point(function (x) return buf.addUnit(x), codePoint);
Utf16Impl.encode_code_point(function (x) buf.addUnit(x), codePoint);
return new Utf16(buf.getStringU16());
}

Expand All @@ -17,7 +17,7 @@ class Utf16 implements Utf {
public static inline function fromCodePoints(codePoints : Iterable<Int>) : Utf16 {
var buf = new StringU16Buffer();
for (c in codePoints) {
Utf16Impl.encode_code_point(function (x) return buf.addUnit(x), c);
Utf16Impl.encode_code_point(function (x) buf.addUnit(x), c);
}
return new Utf16(buf.getStringU16());
}
Expand Down Expand Up @@ -277,7 +277,7 @@ private abstract StringU16Buffer(Array<Int>) {
this = [];
}

public #if !cpp inline #end function addUnit(unit : Int) : Void {
public inline function addUnit(unit : Int) : Void {
this.push(unit);
}

Expand All @@ -291,7 +291,7 @@ private abstract StringU16(Array<Int>) {

public static function fromString(s : String) : StringU16 {
var buf = new StringU16Buffer();
var addUnit = function (x) return buf.addUnit(x);
var addUnit = function (x) buf.addUnit(x);
for (i in new InternalEncodingIter(s, 0, s.length)) {
var c = InternalEncoding.codePointAt(s, i);
Utf16Impl.encode_code_point(addUnit, c);
Expand Down

0 comments on commit 14c797d

Please sign in to comment.