nitlanguage
/
nit.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c79eecb
)
lib/core: Avoid boxing when comparing two NativeString instances
author
Lucas Bajolet
<r4pass@hotmail.com>
Tue, 8 Dec 2015 18:26:36 +0000
(13:26 -0500)
committer
Lucas Bajolet
<r4pass@hotmail.com>
Tue, 29 Dec 2015 04:49:28 +0000
(23:49 -0500)
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>
lib/core/text/native.nit
patch
|
blob
|
history
diff --git
a/lib/core/text/native.nit
b/lib/core/text/native.nit
index
3eb41f2
..
1c9e262
100644
(file)
--- a/
lib/core/text/native.nit
+++ b/
lib/core/text/native.nit
@@
-84,6
+84,10
@@
extern class NativeString `{ char* `}
# Copy `self` to `dest`.
fun copy_to(dest: NativeString, length: Int, from: Int, to: Int) is intern
+ redef fun ==(o) is intern do return is_same_instance(o)
+
+ redef fun !=(o) is intern do return not is_same_instance(o)
+
# Position of the first nul character.
fun cstring_length: Int
do