* @brief Resolves (table, register) to a generation-tagged handle (gen<<24|index), or -1 if * unknown; run once off the hot path. Silent on miss: -1 is the documented sentinel and * probing for optional registers is a legitimate pattern, so (unlike get()) it does not * warn -- a typo surfaces through the name-based get() path instead. */
| 370 | * warn -- a typo surfaces through the name-based get() path instead. |
| 371 | */ |
| 372 | qint64 DataModel::DataTableStore::handleOf(const QString& table, const QString& reg) const |
| 373 | { |
| 374 | Q_ASSERT(m_initialized); |
| 375 | |
| 376 | const int idx = indexOf(table, reg); |
| 377 | if (idx < 0) [[unlikely]] |
| 378 | return -1; |
| 379 | |
| 380 | return (static_cast<qint64>(m_generation) << kHandleIndexBits) | static_cast<qint64>(idx); |
| 381 | } |
| 382 | |
| 383 | /** |
| 384 | * @brief Hot-path read by handle; a stale, out-of-range, or -1 handle is a safe nullptr. |
no outgoing calls
no test coverage detected