1
Fork 0

Use FxHash{Map,Set} instead of the default Hash{Map,Set} everywhere in rustc.

This commit is contained in:
Eduard-Mihai Burtescu 2018-08-18 13:55:43 +03:00
parent 83ddc33347
commit 93f3f5b155
34 changed files with 156 additions and 152 deletions

View file

@ -16,12 +16,12 @@ use {Level, CodeSuggestion, DiagnosticBuilder, SubDiagnostic, SourceMapperDyn, D
use snippet::{Annotation, AnnotationType, Line, MultilineAnnotation, StyledString, Style};
use styled_buffer::StyledBuffer;
use rustc_data_structures::fx::FxHashMap;
use rustc_data_structures::sync::Lrc;
use atty;
use std::borrow::Cow;
use std::io::prelude::*;
use std::io;
use std::collections::HashMap;
use std::cmp::{min, Reverse};
use termcolor::{StandardStream, ColorChoice, ColorSpec, BufferWriter};
use termcolor::{WriteColor, Color, Buffer};
@ -1090,7 +1090,7 @@ impl EmitterWriter {
max_line_num_len + 1);
// Contains the vertical lines' positions for active multiline annotations
let mut multilines = HashMap::new();
let mut multilines = FxHashMap::default();
// Next, output the annotate source for this file
for line_idx in 0..annotated_file.lines.len() {
@ -1109,7 +1109,7 @@ impl EmitterWriter {
width_offset,
code_offset);
let mut to_add = HashMap::new();
let mut to_add = FxHashMap::default();
for (depth, style) in depths {
if multilines.get(&depth).is_some() {

View file

@ -8,11 +8,11 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use std::collections::HashMap;
use rustc_data_structures::fx::FxHashMap;
#[derive(Clone)]
pub struct Registry {
descriptions: HashMap<&'static str, &'static str>,
descriptions: FxHashMap<&'static str, &'static str>,
}
impl Registry {