From bf0008c3683f1d52c9e65e6c562533099ea2fd59 Mon Sep 17 00:00:00 2001 From: brontolosone <177225737+brontolosone@users.noreply.github.com> Date: Tue, 10 Dec 2024 15:31:56 +0000 Subject: [PATCH] link to org.javarosa.core.model.ItemsetBinding.resolveRandomSeed() sourcecode --- packages/xpath/src/lib/collections/sort.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/xpath/src/lib/collections/sort.ts b/packages/xpath/src/lib/collections/sort.ts index 31c023f99..61a256274 100644 --- a/packages/xpath/src/lib/collections/sort.ts +++ b/packages/xpath/src/lib/collections/sort.ts @@ -48,7 +48,7 @@ export const seededRandomize = (values: readonly T[], seed?: number): T[] => let finalSeed: number; // Per issue #49 this is (to an extent) "bug-or-feature-compatible" with JavaRosa's implementation. // org.javarosa.core.model.ItemsetBinding.resolveRandomSeed takes the .longValue() of - // the double produced by randomSeedPathExpr.eval(). + // the double produced by randomSeedPathExpr.eval() — see https://github.com/getodk/javarosa/blob/6ce13527c/src/main/java/org/javarosa/core/model/ItemsetBinding.java#L311:L317 . // That results in a 0L when the double is NaN, which happens (for instance) when there // is a string that does not look like a number (which is a problem in itself, as any non-numeric // looking string will then result in the same seed of 0 — see https://github.com/getodk/javarosa/issues/800).