Skip to content

Commit

Permalink
use values() instead of for loop
Browse files Browse the repository at this point in the history
  • Loading branch information
mondaychen committed Jun 6, 2022
1 parent d0346ff commit 9a7e0be
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions packages/react-devtools-shared/src/backend/agent.js
Original file line number Diff line number Diff line change
Expand Up @@ -313,14 +313,10 @@ export default class Agent extends EventEmitter<{|
}

getIDForNode(node: Object): number | null {
const renderers = [];
for (const rendererID in this._rendererInterfaces) {
const renderer = ((this._rendererInterfaces[
(rendererID: any)
]: any): RendererInterface);
renderers.push(renderer);
}
const rendererInterface = getBestMatchingRendererInterface(renderers, node);
const rendererInterface = getBestMatchingRendererInterface(
this._rendererInterfaces.values(),
node,
);
if (rendererInterface != null) {
return rendererInterface.getFiberIDForNative(node, true);
}
Expand Down

0 comments on commit 9a7e0be

Please sign in to comment.