Skip to content

Commit

Permalink
Merge pull request gtk-rs#701 from EPashkin/replace_hashmap
Browse files Browse the repository at this point in the history
Fix unstable super_calback's list for g_vfs_register_uri_scheme
  • Loading branch information
EPashkin authored Jan 22, 2019
2 parents bbf0f44 + cc59d6a commit cfbc40d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/codegen/function_body_chunk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use chunk::parameter_ffi_call_out;
use env::Env;
use library::{self, ParameterDirection};
use nameutil::get_crate_name;
use std::collections::HashMap;
use std::collections::{BTreeMap, HashMap};

#[derive(Clone, Debug)]
enum Parameter {
Expand Down Expand Up @@ -114,8 +114,8 @@ impl Builder {

// Key: user data index
// Value: (global position used as id, type, callbacks)
let mut group_by_user_data: HashMap<usize, (usize, Option<String>, Vec<&Trampoline>)> =
HashMap::new();
let mut group_by_user_data: BTreeMap<usize, (usize, Option<String>, Vec<&Trampoline>)> =
BTreeMap::new();

// We group arguments by callbacks.
if !self.callbacks.is_empty() || !self.destroys.is_empty() {
Expand Down Expand Up @@ -677,7 +677,7 @@ impl Builder {

fn generate_call(
&self,
calls: &HashMap<usize, (usize, Option<String>, Vec<&Trampoline>)>,
calls: &BTreeMap<usize, (usize, Option<String>, Vec<&Trampoline>)>,
) -> Chunk {
let params = self.generate_func_parameters(calls);
let func = Chunk::FfiCall {
Expand All @@ -695,7 +695,7 @@ impl Builder {
}
fn generate_func_parameters(
&self,
calls: &HashMap<usize, (usize, Option<String>, Vec<&Trampoline>)>,
calls: &BTreeMap<usize, (usize, Option<String>, Vec<&Trampoline>)>,
) -> Vec<Chunk> {
let mut params = Vec::new();
for trans in &self.transformations {
Expand Down

0 comments on commit cfbc40d

Please sign in to comment.