)]}'
{
  "commit": "5e10dcbb80fb7845faa45fc6be8e342396e7f232",
  "tree": "3b16d0707ee94daa4b7f6ec8a9f819421cd15c0c",
  "parents": [
    "0f3ceb0cf386c6bba2c43f6a07728251be7ad9a4"
  ],
  "author": {
    "name": "Marcin Kowalczyk",
    "email": "qrczak@google.com",
    "time": "Fri Mar 06 09:09:20 2026 +0100"
  },
  "committer": {
    "name": "Marcin Kowalczyk",
    "email": "qrczak@google.com",
    "time": "Fri Mar 06 09:25:19 2026 +0100"
  },
  "message": "Move `FieldMap` from a private member class of `FieldHandlerMap` to a public\nstandalone class called `SmallIntMap`.\n\nIts design is not specific to field handlers, and it does not actually depend\non the `Context...` template parameters of `FieldHandlerMap`.\n\nGeneralize it a bit by parameterizing it over:\n* key type (`int` in `FieldHandlerMap`)\n* expected minimum key (1 in `FieldHandlerMap`)\n* maximum array capacity (128 in `FieldHandlerMap`)\n* source construct it from (`absl::flat_hash_map\u003cint, Value\u003e`\n  in `FieldHandlerMap`)\n\n`SmallIntMap` is a map optimized for keys being small integers. It supports only\nlookups, but no incremental building nor iteration.\n\nIt stores a part of the map covering some range of keys starting from\n`expected_min_key` in an array.\n\nAt least `array_capacity` possible keys starting from `expected_min_key` are\nsuitable for array lookup. If all present keys are suitable, the stored array\ncan be smaller than `array_capacity`, covering the range to the largest key.\nIf the map is large, the stored array can be larger than `array_capacity`,\nas long as it is at least 25% full.\n\nOptimizations to `SmallIntMap`:\n* Move `large_map_` behind a pointer to reduce memory usage in the common case.\n* Delay constructing elements of `small_values_` to avoid requiring `Value`\n  to be default-constructible, and to make the code initializing them smaller.\n* Move the slow path of `Find()` to a separate function to inline less code.\n* Add `RIEGELI_ASSUME(_ \u003d\u003d nullptr)` to avoid generating deletion code for an\n  initial assignment to a `std::unique_ptr`.\n\nPiperOrigin-RevId: 879470235\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "a33a1756c97f76e0a3698e5c7cd6566352a2615f",
      "old_mode": 33188,
      "old_path": "riegeli/base/BUILD",
      "new_id": "3e175b9fe5538c99355b8c4b718ad321dc1b2a3f",
      "new_mode": 33188,
      "new_path": "riegeli/base/BUILD"
    },
    {
      "type": "modify",
      "old_id": "b1eae2c8dd126aed54055b8c8b56ecc1ba90d862",
      "old_mode": 33188,
      "old_path": "riegeli/base/iterable.h",
      "new_id": "a57dab83fae2b86095bf69c5d023903027416f92",
      "new_mode": 33188,
      "new_path": "riegeli/base/iterable.h"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "7ded791c9c13960f418f6f54da6b99c11b1f15d4",
      "new_mode": 33188,
      "new_path": "riegeli/base/small_int_map.h"
    },
    {
      "type": "modify",
      "old_id": "04248bf75106fe1ea921712d14631a9bd3b22731",
      "old_mode": 33188,
      "old_path": "riegeli/messages/BUILD",
      "new_id": "9a2fc4a2132851241b7f4aaafe39aae5afd829e9",
      "new_mode": 33188,
      "new_path": "riegeli/messages/BUILD"
    },
    {
      "type": "modify",
      "old_id": "7addc41f34f7d69d97e10960814353eb9ba475f2",
      "old_mode": 33188,
      "old_path": "riegeli/messages/field_handler_map.h",
      "new_id": "f8ab6a0a1686f482377406bdb7a48c89245391e9",
      "new_mode": 33188,
      "new_path": "riegeli/messages/field_handler_map.h"
    }
  ]
}
