luaur_analysis/methods/warning_comparator_compare_linter.rs
1use crate::records::warning_comparator::WarningComparator;
2use luaur_ast::records::position::Position;
3
4impl WarningComparator {
5 #[inline]
6 pub fn compare_position_position(&self, lhs: &Position, rhs: &Position) -> i32 {
7 if lhs.line != rhs.line {
8 return if lhs.line < rhs.line { -1 } else { 1 };
9 }
10 if lhs.column != rhs.column {
11 return if lhs.column < rhs.column { -1 } else { 1 };
12 }
13 0
14 }
15}