mirror of
https://github.com/status-im/realm-js.git
synced 2025-01-27 06:44:56 +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) {
|
void ArrayPropertyNames(JSContextRef ctx, JSObjectRef object, JSPropertyNameAccumulatorRef propertyNames) {
|
||||||
ObjectArray *array = RJSGetInternal<ObjectArray *>(object);
|
ObjectArray *array = RJSGetInternal<ObjectArray *>(object);
|
||||||
|
size_t size = array->size();
|
||||||
|
|
||||||
char str[32];
|
char str[32];
|
||||||
for (int i = 0; i < array->link_view->size(); i++) {
|
for (size_t i = 0; i < size; i++) {
|
||||||
sprintf(str, "%i", i);
|
sprintf(str, "%zu", i);
|
||||||
JSStringRef name = JSStringCreateWithUTF8CString(str);
|
JSStringRef name = JSStringCreateWithUTF8CString(str);
|
||||||
JSPropertyNameAccumulatorAddName(propertyNames, name);
|
JSPropertyNameAccumulatorAddName(propertyNames, name);
|
||||||
JSStringRelease(name);
|
JSStringRelease(name);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user