MCPcopy Create free account
hub / github.com/Predelnik/DSpellCheck / from_original_index

Method from_original_index

src/common/MappedWstring.h:22–24  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20 IndexType to_original_index(IndexType cur_index) const { return !mapping.empty() ? mapping[cur_index] : cur_index; }
21
22 IndexType from_original_index(IndexType cur_index) const {
23 return !mapping.empty() ? static_cast<IndexType>(std::lower_bound(mapping.begin(), mapping.end(), cur_index) - mapping.begin()) : cur_index;
24 }
25
26 IndexType original_length() const { return !mapping.empty() ? mapping.back() : static_cast<IndexType>(str.size()); }
27

Callers 1

get_word_atMethod · 0.80

Calls 3

emptyMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected