mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-30 13:51:37 +00:00
Improve Message
sorting performance (#4624)
This commit is contained in:
parent
17d938f078
commit
85f094f592
4 changed files with 23 additions and 10 deletions
|
@ -6,6 +6,7 @@ use std::ops::Deref;
|
|||
use ruff_text_size::{TextRange, TextSize};
|
||||
use rustc_hash::FxHashMap;
|
||||
|
||||
use crate::jupyter::JupyterIndex;
|
||||
pub use azure::AzureEmitter;
|
||||
pub use github::GithubEmitter;
|
||||
pub use gitlab::GitlabEmitter;
|
||||
|
@ -17,9 +18,6 @@ use ruff_diagnostics::{Diagnostic, DiagnosticKind, Fix};
|
|||
use ruff_python_ast::source_code::{SourceFile, SourceLocation};
|
||||
pub use text::TextEmitter;
|
||||
|
||||
use crate::jupyter::JupyterIndex;
|
||||
use crate::registry::AsRule;
|
||||
|
||||
mod azure;
|
||||
mod diff;
|
||||
mod github;
|
||||
|
@ -77,11 +75,7 @@ impl Message {
|
|||
|
||||
impl Ord for Message {
|
||||
fn cmp(&self, other: &Self) -> Ordering {
|
||||
(self.filename(), self.start(), self.kind.rule()).cmp(&(
|
||||
other.filename(),
|
||||
other.start(),
|
||||
other.kind.rule(),
|
||||
))
|
||||
(&self.file, self.start()).cmp(&(&other.file, other.start()))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue