# perf\(ledger\): optimize CommandLedger entry lookups in account command loops · lucenx/codexbar-plasma

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

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

Visibility: public

Requested revision: 01d406daf8e4429761b741186a648ffbced1b859

Requested commit: 01d406daf8e4429761b741186a648ffbced1b859

Commit: 01d406daf8e4429761b741186a648ffbced1b859

Tree: 0a2e0a9f655c26598330c46cd7f0f598da405ec8

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

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

## Message

```
perf(ledger): optimize CommandLedger entry lookups in account 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

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

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