mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-30 19:30:01 +00:00
Fixed VS assignment constructor warning.
This commit is contained in:
@@ -1117,14 +1117,14 @@ FLATBUFFERS_FINAL_CLASS
|
|||||||
bool force_defaults_; // Serialize values equal to their defaults anyway.
|
bool force_defaults_; // Serialize values equal to their defaults anyway.
|
||||||
|
|
||||||
struct StringOffsetCompare {
|
struct StringOffsetCompare {
|
||||||
StringOffsetCompare(const vector_downward &buf) : buf_(buf) {}
|
StringOffsetCompare(const vector_downward &buf) : buf_(&buf) {}
|
||||||
bool operator() (const Offset<String> &a, const Offset<String> &b) const {
|
bool operator() (const Offset<String> &a, const Offset<String> &b) const {
|
||||||
auto stra = reinterpret_cast<const String *>(buf_.data_at(a.o));
|
auto stra = reinterpret_cast<const String *>(buf_->data_at(a.o));
|
||||||
auto strb = reinterpret_cast<const String *>(buf_.data_at(b.o));
|
auto strb = reinterpret_cast<const String *>(buf_->data_at(b.o));
|
||||||
return strncmp(stra->c_str(), strb->c_str(),
|
return strncmp(stra->c_str(), strb->c_str(),
|
||||||
std::min(stra->size(), strb->size()) + 1) < 0;
|
std::min(stra->size(), strb->size()) + 1) < 0;
|
||||||
}
|
}
|
||||||
const vector_downward &buf_;
|
const vector_downward *buf_;
|
||||||
};
|
};
|
||||||
|
|
||||||
// For use with CreateSharedString. Instantiated on first use only.
|
// For use with CreateSharedString. Instantiated on first use only.
|
||||||
|
|||||||
Reference in New Issue
Block a user