diff --git a/Cargo.lock b/Cargo.lock index 29c05c0..b0fddd5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7,7 +7,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "aise" -version = "2.21.4" +version = "2.22.0" dependencies = [ "backtrace 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", "bincode 1.1.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -19,7 +19,6 @@ dependencies = [ "directories 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.19.6 (registry+https://github.com/rust-lang/crates.io-index)", "fern 0.5.7 (registry+https://github.com/rust-lang/crates.io-index)", - "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "font-kit 0.1.0 (git+https://github.com/pcwalton/font-kit?rev=7e6a5599bd7f2b1a0166ce868e72a76086f317cb)", "fxhash 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "gl 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/Cargo.toml b/Cargo.toml index 8cf8179..9cc4f06 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "aise" -version = "2.21.4" +version = "2.22.0" authors = ["Markus Heikkinen "] [lib] @@ -40,7 +40,6 @@ thread_local = "0.3.5" cgmath = { version = "0.16", optional = true } euclid = { version = "0.19", optional = true } -fnv = { version = "1.0.6", optional = true } glium = { version = "0.22", optional = true, default-features = false } gl = { version = "0.10", optional = true } @@ -67,4 +66,4 @@ git = "https://github.com/neivv/whack/" git = "https://github.com/neivv/samase_plugin" [features] -opengl = ["cgmath", "euclid", "fnv", "font-kit", "glium", "gl"] +opengl = ["cgmath", "euclid", "font-kit", "glium", "gl"] diff --git a/src/gl/text.rs b/src/gl/text.rs index c607f67..2986da9 100644 --- a/src/gl/text.rs +++ b/src/gl/text.rs @@ -1,10 +1,10 @@ use std::borrow::Cow; use std::rc::Rc; -use fnv::FnvHashMap; use font_kit::canvas::{self, Canvas, RasterizationOptions}; use font_kit::font::Font; use font_kit::hinting::HintingOptions; +use fxhash::FxHashMap; use glium::backend::Facade; use glium::texture::{ClientFormat, RawImage2d, Texture2d}; @@ -22,7 +22,7 @@ pub struct BufferCoord { struct BufferCoordMap { // FIXME: Should store glyph ids so chars with equal glyphs don't waste memory ascii: Vec>, - other: FnvHashMap, + other: FxHashMap, } impl BufferCoordMap { diff --git a/src/idle_orders.rs b/src/idle_orders.rs index 07a469e..13b96bc 100644 --- a/src/idle_orders.rs +++ b/src/idle_orders.rs @@ -1120,8 +1120,8 @@ impl InCombatCache { if recently_attacked { // Workers need actual non-neutral targets so that they aren't in combat // from mining cooldown. - let is_mining = unit.id().is_worker() && - unit.target().map(|x| x.player() == 11).unwrap_or(true); + let is_mining = + unit.id().is_worker() && unit.target().map(|x| x.player() == 11).unwrap_or(true); if !is_mining { return true; } diff --git a/src/lib.rs b/src/lib.rs index c3dd5ad..0b3b1e3 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -37,8 +37,6 @@ extern crate cgmath; #[cfg(feature = "opengl")] extern crate euclid; #[cfg(feature = "opengl")] -extern crate fnv; -#[cfg(feature = "opengl")] extern crate font_kit; #[cfg(feature = "opengl")] extern crate gl as opengl; diff --git a/src/unit.rs b/src/unit.rs index 9dc4c1c..e53dbe1 100644 --- a/src/unit.rs +++ b/src/unit.rs @@ -1,9 +1,9 @@ use std::cell::RefCell; -use std::collections::HashMap; use std::hash::{Hash, Hasher}; use std::ptr::null_mut; use byteorder::{ReadBytesExt, LE}; +use fxhash::FxHashMap; use serde::{Deserialize, Deserializer, Serialize, Serializer}; use bw; @@ -111,8 +111,10 @@ impl Iterator for SaveIdMapping { } ome2_thread_local! { - SAVE_ID_MAP: RefCell> = save_mapping(RefCell::new(HashMap::new())); - LOAD_ID_MAP: RefCell> = load_mapping(RefCell::new(HashMap::new())); + SAVE_ID_MAP: RefCell> = + save_mapping(RefCell::new(FxHashMap::default())); + LOAD_ID_MAP: RefCell> = + load_mapping(RefCell::new(FxHashMap::default())); } pub fn init_save_mapping() {