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

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

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

Visibility: public

Requested revision: 3b833287c49724d81d6532795f07f3c0525e42d7

Requested commit: 3b833287c49724d81d6532795f07f3c0525e42d7

Commit: 3b833287c49724d81d6532795f07f3c0525e42d7

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

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

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