Skip to content

Commit

Permalink
Switch to BTreeMap from HashMap (#196)
Browse files Browse the repository at this point in the history
  • Loading branch information
memorycode authored Aug 28, 2023
1 parent 9857df5 commit 069d2ef
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions mantle/rbx_mantle/src/state/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ pub mod v4;
pub mod v5;

use std::{
collections::HashMap,
collections::BTreeMap,
ffi::OsStr,
fs,
path::{Path, PathBuf},
Expand Down Expand Up @@ -191,7 +191,7 @@ pub async fn get_state_from_source(
}
Some(ResourceState::Versioned(VersionedResourceState::V5(state))) => state,
None => ResourceStateVLatest {
environments: HashMap::new(),
environments: BTreeMap::new(),
},
})
}
Expand Down
4 changes: 2 additions & 2 deletions mantle/rbx_mantle/src/state/v4.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::collections::HashMap;
use std::collections::{BTreeMap, HashMap};

use serde::{Deserialize, Serialize};

Expand All @@ -13,7 +13,7 @@ pub struct ResourceStateV4 {

impl From<ResourceStateV4> for ResourceStateV5 {
fn from(state: ResourceStateV4) -> Self {
let mut environments = HashMap::new();
let mut environments = BTreeMap::new();

for (environment_name, resources) in state.environments {
let mut environment: Vec<RobloxResource> = Vec::new();
Expand Down
4 changes: 2 additions & 2 deletions mantle/rbx_mantle/src/state/v5.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
use std::collections::HashMap;
use std::collections::BTreeMap;

use serde::{Deserialize, Serialize};

use super::super::roblox_resource_manager::RobloxResource;

#[derive(Serialize, Deserialize, Clone)]
pub struct ResourceStateV5 {
pub environments: HashMap<String, Vec<RobloxResource>>,
pub environments: BTreeMap<String, Vec<RobloxResource>>,
}

1 comment on commit 069d2ef

@vercel
Copy link

@vercel vercel bot commented on 069d2ef Aug 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.