message: Use find_w_len in view::find
diff: @@ -114,14 +114,6 @@ view::const_iterator view::find(stdx::string_view key) const {
  }
  bson_iter_t iter;
  - if (!bson_iter_init(&iter, &b)) {
  - return cend();
  - }
  -
  - // See CDRIVER-2414: If we had a bson_iter_find_init that accepted
  - // the key length, then we could call it without needing to make a
  - // temporary std::string from the 'key', obviating the need for
  - // most of the rest of this method.
  // Logically, a default constructed string_view represents the
  // empty string just as does string_view(""), but they have,
  @@ -132,25 +124,17 @@ view::const_iterator view::find(stdx::string_view key) const {
  // returns nullptr, then, barring undefined behavior, its length
  // is known to be zero, and it is equivalent to the empty string,
  // an instance of which we reset it to.
  - if (key.data() == nullptr)
  + if (key.data() == nullptr) {
  key = "";
  -
  - while (bson_iter_next(&iter)) {
  - // See CDRIVER-2414: If bson_iter_key returned the length, we
  - // could avoid the strlen, or, better still, not use strncmp
  - // by using an O(1) promotion to stdx::string view, and then
  - // using the relops for that class on both sides.
  - const auto ikey = bson_iter_key(&iter);
  - if ((0 == strncmp(key.data(), ikey, key.size())) && (strlen(ikey) == key.size())) {
  - // NOTE: Technically, we are here accessing internals of bson_iter_t, which
  - // we should not do.
  - return const_iterator(element(iter.raw, iter.len, iter.off));
  - }
  }
  + if (!bson_iter_init_find_w_len(&iter, &b, key.data(), static_cast<int>(key.size()))) {
  return cend();
  }
  + return const_iterator(element(iter.raw, iter.len, iter.off));
  +}
  +
  element view::operator[](stdx::string_view key) const {
  return *(this->find(key));
  }
  