mirror of
https://github.com/MaskRay/ccls.git
synced 2024-11-29 19:07:08 +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) {
|
||||
// See GetBufferLineFromIndexLine for additional comments.
|
||||
|
||||
// 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();
|
||||
if (line < 0 || line >= (int)buffer_lines.size())
|
||||
return nullopt;
|
||||
}
|
||||
|
||||
if (buffer_to_index.empty())
|
||||
ComputeLineMapping();
|
||||
|
Loading…
Reference in New Issue
Block a user