code: private int tags_index(dictionary_delta dict_delta, Tags tags) {
          final BiMap<Tags, Integer> dict = from_.getTagDict().inverse();
          final Integer resolved = dict.get(tags);
          if (resolved != null) return resolved;
  
          final int allocated = allocate_index_(dict);
          dict.put(tags, allocated);
  
          // Create new pdd for serialization.
          tag_dictionary_delta tdd = new tag_dictionary_delta();
          tdd.id = allocated;
          tdd.value = new tags();
          tdd.value.elems = tags.stream()
                  .map(entry -> {
                      tag_elem elem = new tag_elem();
                      elem.key = entry.getKey();
                      elem.value = metric_value_(dict_delta, entry.getValue());
                      return elem;
                  })
                  .toArray(tag_elem[]::new);
          // Append new entry to array.
          dict_delta.tdd = Stream.concat(Arrays.stream(dict_delta.tdd), Stream.of(tdd))
                  .toArray(tag_dictionary_delta[]::new);
          LOG.log(Level.FINE, "dict_delta.tdd: {0} items (added {1})", new Object[]{dict_delta.tdd.length, tags});
  
          return allocated;
      }
docs: Lookup the index for the argument, or if it isn't present, create one.