Skip to content

Commit

Permalink
chore(client): increase .all property performance by not creating a c…
Browse files Browse the repository at this point in the history
…opy on an already frozen instance
  • Loading branch information
xLuxy committed Mar 29, 2024
1 parent 1714dcb commit e30f4e3
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion client/src/bindings/AudioOutput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ static void AllAudioOutputGetter(v8::Local<v8::String> name, const v8::PropertyC
{
V8_GET_ISOLATE_CONTEXT_RESOURCE();

V8_RETURN(resource->GetAllAudioOutputs()->Clone());
V8_RETURN(resource->GetAllAudioOutputs());
}

static void AudioOutputCountGetter(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info)
Expand Down
2 changes: 1 addition & 1 deletion client/src/bindings/Player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ static void AllGetter(v8::Local<v8::String> name, const v8::PropertyCallbackInfo
{
V8_GET_ISOLATE_CONTEXT_RESOURCE();

V8_RETURN(resource->GetAllPlayers()->Clone());
V8_RETURN(resource->GetAllPlayers());
}

static void CountGetter(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info)
Expand Down
2 changes: 1 addition & 1 deletion client/src/bindings/Vehicle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ static void AllGetter(v8::Local<v8::String> name, const v8::PropertyCallbackInfo
{
V8_GET_ISOLATE_CONTEXT_RESOURCE();

V8_RETURN(resource->GetAllVehicles()->Clone());
V8_RETURN(resource->GetAllVehicles());
}

static void CountGetter(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info)
Expand Down
2 changes: 1 addition & 1 deletion shared/bindings/Blip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ static void AllGetter(v8::Local<v8::String> name, const v8::PropertyCallbackInfo
{
V8_GET_ISOLATE_CONTEXT_RESOURCE();

V8_RETURN(resource->GetAllBlips()->Clone());
V8_RETURN(resource->GetAllBlips());
}

static void CountGetter(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info)
Expand Down
2 changes: 1 addition & 1 deletion shared/bindings/ColShape.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ static void AllGetter(v8::Local<v8::String> name, const v8::PropertyCallbackInfo
{
V8_GET_ISOLATE_CONTEXT_RESOURCE();

V8_RETURN(resource->GetAllColshapes()->Clone());
V8_RETURN(resource->GetAllColshapes());
}

static void StaticGetByID(const v8::FunctionCallbackInfo<v8::Value>& info)
Expand Down
2 changes: 1 addition & 1 deletion shared/bindings/Marker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ static void AllGetter(v8::Local<v8::String> name, const v8::PropertyCallbackInfo
{
V8_GET_ISOLATE_CONTEXT_RESOURCE();

V8_RETURN(resource->GetAllMarkers()->Clone());
V8_RETURN(resource->GetAllMarkers());
}

static void TypeGetter(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
Expand Down

0 comments on commit e30f4e3

Please sign in to comment.