Some speed improvements
This commit is contained in:
@@ -88,11 +88,15 @@ obj string (Object, Serializable) {
|
||||
return this;
|
||||
}
|
||||
fun construct(str: *char): *string {
|
||||
data.construct();
|
||||
while(*str) {
|
||||
data.addEnd(*str);
|
||||
str += 1;
|
||||
}
|
||||
var len = 0
|
||||
while (str[len] != 0) len++
|
||||
data.construct(len);
|
||||
data.set_size(len);
|
||||
mem::memmove((data.getBackingMemory()) cast *void, (str) cast *void, (len) cast ulong)
|
||||
/*while(*str) {*/
|
||||
/*data.addEnd(*str);*/
|
||||
/*str += 1;*/
|
||||
/*}*/
|
||||
// no null terminator
|
||||
return this;
|
||||
}
|
||||
@@ -118,8 +122,6 @@ obj string (Object, Serializable) {
|
||||
}
|
||||
|
||||
fun operator=(str: ref string): void {
|
||||
/*destruct();*/
|
||||
/*data.copy_construct(&str.data)*/
|
||||
data = str.data
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user