mirror of
https://github.com/lovell/sharp.git
synced 2025-07-09 18:40:16 +02:00
Avoid copy in metadata levels for loop
This commit is contained in:
parent
fdfc89e577
commit
ab015ef90f
@ -189,7 +189,7 @@ class MetadataWorker : public Napi::AsyncWorker {
|
|||||||
if (!baton->levels.empty()) {
|
if (!baton->levels.empty()) {
|
||||||
int i = 0;
|
int i = 0;
|
||||||
Napi::Array levels = Napi::Array::New(env, static_cast<size_t>(baton->levels.size()));
|
Napi::Array levels = Napi::Array::New(env, static_cast<size_t>(baton->levels.size()));
|
||||||
for (std::pair<int, int> const l : baton->levels) {
|
for (std::pair<int, int> const &l : baton->levels) {
|
||||||
Napi::Object level = Napi::Object::New(env);
|
Napi::Object level = Napi::Object::New(env);
|
||||||
level.Set("width", l.first);
|
level.Set("width", l.first);
|
||||||
level.Set("height", l.second);
|
level.Set("height", l.second);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user