mirror of
https://github.com/status-im/realm-js.git
synced 2025-01-26 22:39:05 +00:00
Minor optimization of ArrayPropertyNames
This commit is contained in:
parent
38a4e993ae
commit
37130ceca3
@ -75,10 +75,11 @@ JSValueRef ArrayGetProperty(JSContextRef ctx, JSObjectRef object, JSStringRef pr
|
||||
|
||||
void ArrayPropertyNames(JSContextRef ctx, JSObjectRef object, JSPropertyNameAccumulatorRef propertyNames) {
|
||||
ObjectArray *array = RJSGetInternal<ObjectArray *>(object);
|
||||
size_t size = array->size();
|
||||
|
||||
char str[32];
|
||||
for (int i = 0; i < array->link_view->size(); i++) {
|
||||
sprintf(str, "%i", i);
|
||||
for (size_t i = 0; i < size; i++) {
|
||||
sprintf(str, "%zu", i);
|
||||
JSStringRef name = JSStringCreateWithUTF8CString(str);
|
||||
JSPropertyNameAccumulatorAddName(propertyNames, name);
|
||||
JSStringRelease(name);
|
||||
|
Loading…
x
Reference in New Issue
Block a user