mirror of
https://github.com/MaskRay/ccls.git
synced 2024-11-26 09:31:59 +00:00
Remove GetIndexPosFromBufferPos range check
This commit is contained in:
parent
6c45663002
commit
57e95590e8
@ -332,15 +332,8 @@ optional<int> WorkingFile::GetBufferPosFromIndexPos(int line, int* column, bool
|
|||||||
|
|
||||||
optional<int> WorkingFile::GetIndexPosFromBufferPos(int line, int* column, bool is_end) {
|
optional<int> WorkingFile::GetIndexPosFromBufferPos(int line, int* column, bool is_end) {
|
||||||
// See GetBufferLineFromIndexLine for additional comments.
|
// See GetBufferLineFromIndexLine for additional comments.
|
||||||
|
if (line < 0 || line >= (int)buffer_lines.size())
|
||||||
// Note: |index_line| and |buffer_line| are 1-based.
|
|
||||||
if (line < 0 || line >= (int)buffer_lines.size()) {
|
|
||||||
loguru::Text stack = loguru::stacktrace();
|
|
||||||
LOG_S(WARNING) << "Bad buffer_line (got " << line
|
|
||||||
<< ", expected [1, " << buffer_lines.size() << "]) in "
|
|
||||||
<< filename << stack.c_str();
|
|
||||||
return nullopt;
|
return nullopt;
|
||||||
}
|
|
||||||
|
|
||||||
if (buffer_to_index.empty())
|
if (buffer_to_index.empty())
|
||||||
ComputeLineMapping();
|
ComputeLineMapping();
|
||||||
|
Loading…
Reference in New Issue
Block a user