|
|
@@ -179,19 +179,27 @@ bool build_records(const reader::Source& source,
|
|
|
continue;
|
|
|
}
|
|
|
const std::int16_t named = isValue ? raw : rawFlag;
|
|
|
+ // Both maps, always. Twelve books name only a flag here and their bars stay dead;
|
|
|
+ // if the same raw number also resolves in the value map, that index is the bar's
|
|
|
+ // source and nobody has looked because the flag reading answered first.
|
|
|
int mapped = -1;
|
|
|
+ int asValue = -1;
|
|
|
if (addressable_slot(named) && static_cast<std::size_t>(named) < kSlotSpace) {
|
|
|
mapped = isValue ? static_cast<int>(valueIndexBySlot[
|
|
|
static_cast<std::size_t>(named)])
|
|
|
: static_cast<int>(indexBySlot[
|
|
|
static_cast<std::size_t>(named)]);
|
|
|
+ asValue = !valueIndexBySlot.empty()
|
|
|
+ ? static_cast<int>(
|
|
|
+ valueIndexBySlot[static_cast<std::size_t>(named)])
|
|
|
+ : -1;
|
|
|
}
|
|
|
std::array<char, 160> line{};
|
|
|
const int told = std::snprintf(
|
|
|
line.data(), line.size(),
|
|
|
- "ev=records stage=parent_expr row=%llu field=%zu kind=%s raw=%d mapped=%d",
|
|
|
+ "ev=records stage=parent_expr row=%llu field=%zu kind=%s raw=%d mapped=%d as_value=%d",
|
|
|
static_cast<unsigned long long>(row), field, isValue ? "value" : "flag",
|
|
|
- static_cast<int>(named), mapped);
|
|
|
+ static_cast<int>(named), mapped, asValue);
|
|
|
if (told > 0) {
|
|
|
core::log::write(core::log::Channel::client, core::log::Level::info,
|
|
|
{line.data(), static_cast<std::size_t>(told)});
|