mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-11 13:52:20 +00:00
docs(labs): describe the registry listing by what uses it
Rewords a code comment that referred to the work by its planning step, and a loop counter's comment, to say what the code does.
This commit is contained in:
1 parent
eabbe3e032
commit
ec57ae10b1
2 files changed
+3
-3
No files matched your search
@@ -30,10 +30,10 @@ export async function ensureAnalyteKey(
|
||||
marker: MarkerKeyState,
|
||||
): Promise<string | null> {
|
||||
let current: MarkerKeyState = marker;
|
||||
// Two rounds: the caller's copy, then the row as it stands if that copy was
|
||||
// Two attempts: the caller's copy, then the row as it stands if that copy was
|
||||
// stale. A third writer racing both is vanishingly rare; the derived key is
|
||||
// still the right answer for the name this call saw.
|
||||
for (let round = 0; round < 2; round++) {
|
||||
for (let attempt = 0; attempt < 2; attempt++) {
|
||||
const derived = matchAnalyteKey({ name: current.name, unit: current.unit });
|
||||
const stored = current.analyteKey ?? null;
|
||||
if (stored === derived) return derived;
|
||||
|
||||
@@ -230,7 +230,7 @@ export function analyteConversionFor(
|
||||
return analyteKey ? (BY_KEY.get(analyteKey) ?? null) : null;
|
||||
}
|
||||
|
||||
/** Every entry, once each, for the guard test and for phase 3's key matching. */
|
||||
/** Every entry, once each, for the guard test and the analyte key matching. */
|
||||
export function allAnalyteConversions(): readonly AnalyteConversion[] {
|
||||
return ENTRIES;
|
||||
}
|
||||
Reference in new issue
Block a user