Repository: google/flatbuffers
File: include/flatbuffers/verifier.h (C/C++)

Code before:
    Options(uoffset_t d, uoffset_t t, bool a, bool n)
        : max_depth(d),
          max_tables(t),
          check_alignment(a),
          check_nested_flatbuffers(n) {}
  };


  Verifier(const uint8_t *const buf, const size_t buf_len, const Options opts)
      : buf_(buf),
        size_(buf_len),
        opts_(opts),
        upper_bound_(0),
        depth_(0),
        num_tables_(0),
        flex_reuse_tracker_(nullptr) {
    FLATBUFFERS_ASSERT(size_ < FLATBUFFERS_MAX_BUFFER_SIZE);
  }

  // Deprecated API, please construct with Verifier::Options.
  Verifier(const uint8_t *const buf, const size_t buf_len,
           const uoffset_t _max_depth = 64,
           const uoffset_t _max_tables = 1000000,
           const bool _check_alignment = true,
           const bool _check_nested_flatbuffers = true)
      : Verifier(buf, buf_len, {
        _max_depth, _max_tables, _check_alignment,
               _check_nested_flatbuffers
      }) {}

  // Central location where any verification failures register.
  bool Check(const bool ok) const {
    // clang-format off
    #ifdef FLATBUFFERS_DEBUG_VERIFICATION_FAILURE
      FLATBUFFERS_ASSERT(ok);
    #endif
    #ifdef FLATBUFFERS_TRACK_VERIFIER_BUFFER_SIZE
      if (!ok)
        upper_bound_ = 0;
    #endif
    // clang-format on
    return ok;
  }

  // Verify any range within the buffer.
  bool Verify(const size_t elem, const size_t elem_len) const {
    // clang-format off
    #ifdef FLATBUFFERS_TRACK_VERIFIER_BUFFER_SIZE
      auto upper_bound = elem + elem_len;
      if (upper_bound_ < upper_bound)
        upper_bound_ =  upper_bound;

Review comment (suggestion):
ah, i was just going to have it not call another constructor.

```
 Verifier(const uint8_t *const buf, const size_t buf_len,
           const uoffset_t _max_depth = 64,
           const uoffset_t _max_tables = 1000000,
           const bool _check_alignment = true) 
             : buf_(buf), etc...
           {
             opts_.max_depth = _max_depth;
             opts_.max_tables = _max_tables;
             etc...
             
           
           }
```
            


Code after:
    Options(uoffset_t d, uoffset_t t, bool a, bool n)
        : max_depth(d),
          max_tables(t),
          check_alignment(a),
          check_nested_flatbuffers(n) {}
  };

  Verifier(const uint8_t *const buf, const size_t buf_len, const Options opts)
      : buf_(buf),
        size_(buf_len),
        opts_(opts),
        upper_bound_(0),
        depth_(0),
        num_tables_(0),
        flex_reuse_tracker_(nullptr) {
    FLATBUFFERS_ASSERT(size_ < FLATBUFFERS_MAX_BUFFER_SIZE);
  }

  // Deprecated API, please construct with Verifier::Options.
  Verifier(const uint8_t *const buf, const size_t buf_len,
           const uoffset_t _max_depth = 64,
           const uoffset_t _max_tables = 1000000,
           const bool _check_alignment = true)
      : Verifier(buf, buf_len,
                 {
                     _max_depth,
                     _max_tables,
                     _check_alignment,
                     true,
                 }) {}

  // Central location where any verification failures register.
  bool Check(const bool ok) const {
    // clang-format off
    #ifdef FLATBUFFERS_DEBUG_VERIFICATION_FAILURE
      FLATBUFFERS_ASSERT(ok);
    #endif
    #ifdef FLATBUFFERS_TRACK_VERIFIER_BUFFER_SIZE
      if (!ok)
        upper_bound_ = 0;
    #endif
    // clang-format on
    return ok;
  }

  // Verify any range within the buffer.
  bool Verify(const size_t elem, const size_t elem_len) const {
    // clang-format off
    #ifdef FLATBUFFERS_TRACK_VERIFIER_BUFFER_SIZE
      auto upper_bound = elem + elem_len;
      if (upper_bound_ < upper_bound)