fn lessThanByWeight(
weights: [256]u4,
lhs: PrefixedSymbol,
rhs: PrefixedSymbol,
) bool weights: [256]u4lhs: PrefixedSymbolrhs: PrefixedSymbol1268
1269
1270
1271
1272
1273
1274
1275
1276
1277 fn lessThanByWeight(
weights: [256]u4,
lhs: PrefixedSymbol,
rhs: PrefixedSymbol,
) bool {
// NOTE: this function relies on the use of a stable sorting algorithm,
// otherwise a special case of if (weights[lhs] == weights[rhs]) return lhs < rhs;
// should be added
return weights[lhs.symbol] < weights[rhs.symbol];
}