# perf: eliminate redundant CommandLedger lookups in command loops · lucenx/codexbar-plasma

[View on GitCafe](https://git.cafe/lucenx/codexbar-plasma/commit/fff5e6e28c4c9d5a9559b10fcae019e55af8ae24)

Repository: [lucenx/codexbar-plasma](https://git.cafe/lucenx/codexbar-plasma)

Visibility: public

Requested revision: fff5e6e28c4c9d5a9559b10fcae019e55af8ae24

Requested commit: fff5e6e28c4c9d5a9559b10fcae019e55af8ae24

Commit: fff5e6e28c4c9d5a9559b10fcae019e55af8ae24

Tree: 0a2e0a9f655c26598330c46cd7f0f598da405ec8

Author: google-labs-jules\[bot\]

Committer: google-labs-jules\[bot\]

## Message

```
perf: eliminate redundant CommandLedger lookups in command loops

Avoid calling CommandLedger.find inside loops over command sources in
retireStaleAccountCommands and AccountRequests.isLoading by providing
CommandLedger.entriesOfKind which returns source names and descriptors in a
single pass. Also optimize CommandLedger.hasKind to short-circuit on match.

Co-authored-by: Lucenx9 <185146821+Lucenx9@users.noreply.github.com>

```

## Parents

- [d09e5b6dc0ffcb1eeb4625b9c0eb03a9b6598cb3](https://git.cafe/lucenx/codexbar-plasma/commit/d09e5b6dc0ffcb1eeb4625b9c0eb03a9b6598cb3?format=markdown)

[Source at this commit](https://git.cafe/lucenx/codexbar-plasma/tree/fff5e6e28c4c9d5a9559b10fcae019e55af8ae24?format=markdown)
