Skip to content

Commit

Permalink
Change a couple more HashMaps to BTreeMaps
Browse files Browse the repository at this point in the history
  • Loading branch information
CouleeApps committed May 30, 2024
1 parent 1239558 commit 3302252
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions rust/examples/pdb-ng/src/symbol_parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

use std::collections::{BTreeMap, HashMap, HashSet};
use std::collections::{BTreeMap, BTreeSet, HashMap, HashSet};
use std::mem;

use anyhow::{anyhow, Result};
Expand Down Expand Up @@ -209,7 +209,7 @@ impl<'a, S: Source<'a> + 'a> PDBParserInstance<'a, S> {
self.settings
.get_bool("pdb.features.loadGlobalSymbols", Some(self.bv), None);

let mut best_symbols = HashMap::<String, &ParsedSymbol>::new();
let mut best_symbols = BTreeMap::<String, &ParsedSymbol>::new();
for sym in &self.parsed_symbols {
match sym {
ParsedSymbol::Data(ParsedDataSymbol {
Expand Down Expand Up @@ -267,7 +267,7 @@ impl<'a, S: Source<'a> + 'a> PDBParserInstance<'a, S> {
}
}

let mut best_functions = HashMap::<String, &ParsedSymbol>::new();
let mut best_functions = BTreeMap::<String, &ParsedSymbol>::new();
for sym in &self.parsed_symbols {
match sym {
ParsedSymbol::Procedure(ParsedProcedure {
Expand Down Expand Up @@ -505,7 +505,7 @@ impl<'a, S: Source<'a> + 'a> PDBParserInstance<'a, S> {
symbols.seek(first);
}

let mut final_symbols = HashSet::new();
let mut final_symbols = BTreeSet::new();

for root_idx in top_level_syms {
for child_idx in self.walk_children(root_idx).into_iter() {
Expand Down Expand Up @@ -1680,7 +1680,7 @@ impl<'a, S: Source<'a> + 'a> PDBParserInstance<'a, S> {

let mut params = vec![];
let mut locals = vec![];
let mut seen_offsets = HashSet::new();
let mut seen_offsets = BTreeSet::new();

for child in self.symbol_children(index) {
match self.lookup_symbol(&child) {
Expand Down Expand Up @@ -1818,7 +1818,7 @@ impl<'a, S: Source<'a> + 'a> PDBParserInstance<'a, S> {

// These have types but they aren't actually set anywhere. So it's the demangler's
// job to take care of them, apparently?
let name_to_type: HashMap<String, Vec<String>> = HashMap::from_iter([
let name_to_type: BTreeMap<String, Vec<String>> = BTreeMap::from_iter([
(
"`RTTI Complete Object Locator'".to_string(),
vec![
Expand Down
4 changes: 2 additions & 2 deletions rust/examples/pdb-ng/src/type_parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

use std::collections::HashMap;
use std::collections::{BTreeMap, HashMap};

use anyhow::{anyhow, Result};
use binaryninja::architecture::{Architecture, CoreArchitecture};
Expand Down Expand Up @@ -791,7 +791,7 @@ impl<'a, S: Source<'a> + 'a> PDBParserInstance<'a, S> {
finder: &mut ItemFinder<TypeIndex>,
) -> Result<()> {
let mut base_classes = vec![];
let mut virt_methods = HashMap::new();
let mut virt_methods = BTreeMap::new();
let mut non_virt_methods = Vec::new();

let mut members = vec![];
Expand Down

0 comments on commit 3302252

Please sign in to comment.