mirror of
https://github.com/lovell/sharp.git
synced 2025-07-09 10:30:15 +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()) {
|
||||
int i = 0;
|
||||
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);
|
||||
level.Set("width", l.first);
|
||||
level.Set("height", l.second);
|
||||
|
Loading…
x
Reference in New Issue
Block a user