faster isNull, isNotNull
This commit is contained in:
@@ -186,7 +186,8 @@ class Kiss {
|
|||||||
"readDirectory" => Symbol("Prelude.readDirectory"),
|
"readDirectory" => Symbol("Prelude.readDirectory"),
|
||||||
"substr" => Symbol("Prelude.substr"),
|
"substr" => Symbol("Prelude.substr"),
|
||||||
"isListExp" => Symbol("Prelude.isListExp"),
|
"isListExp" => Symbol("Prelude.isListExp"),
|
||||||
"isNull" => Symbol("Prelude.isNull")
|
"isNull" => Symbol("Prelude.isNull"),
|
||||||
|
"isNotNull" => Symbol("Prelude.isNotNull")
|
||||||
/* zip functions used to live here as aliases but now they are macros that also
|
/* zip functions used to live here as aliases but now they are macros that also
|
||||||
apply (the Array<Array<Dynamic>>) to the result */
|
apply (the Array<Array<Dynamic>>) to the result */
|
||||||
/* intersect used to live here as an alias but now it is in a macro that also
|
/* intersect used to live here as an alias but now it is in a macro that also
|
||||||
|
|||||||
@@ -431,11 +431,12 @@ class Prelude {
|
|||||||
|
|
||||||
public static var joinPath:Function = Reflect.makeVarArgs(_joinPath);
|
public static var joinPath:Function = Reflect.makeVarArgs(_joinPath);
|
||||||
|
|
||||||
public static function isNull<T>(v:T) {
|
public static function isNull<T>(v:Null<T>) {
|
||||||
return switch (Type.typeof(v)) {
|
return v == null;
|
||||||
case TNull: true;
|
}
|
||||||
default: false;
|
|
||||||
}
|
public static function isNotNull<T>(v:Null<T>) {
|
||||||
|
return v != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static dynamic function truthy<T>(v:T) {
|
public static dynamic function truthy<T>(v:T) {
|
||||||
|
|||||||
Reference in New Issue
Block a user