@@ -996,10 +996,10 @@ pub fn stream_chunks_of_combined_source_map(
996
996
let source_mapping: RefCell < HashMap < ArcStr , u32 > > =
997
997
RefCell :: new ( HashMap :: default ( ) ) ;
998
998
let mut name_mapping: HashMap < ArcStr , u32 > = HashMap :: default ( ) ;
999
- let source_index_mapping: RefCell < HashMap < i64 , i64 > > =
1000
- RefCell :: new ( HashMap :: default ( ) ) ;
1001
- let name_index_mapping: RefCell < HashMap < i64 , i64 > > =
1002
- RefCell :: new ( HashMap :: default ( ) ) ;
999
+ let source_index_mapping: RefCell < Vec < i64 > > =
1000
+ RefCell :: new ( Vec :: with_capacity ( source_map . sources ( ) . len ( ) ) ) ;
1001
+ let name_index_mapping: RefCell < Vec < i64 > > =
1002
+ RefCell :: new ( Vec :: with_capacity ( source_map . names ( ) . len ( ) ) ) ;
1003
1003
let name_index_value_mapping: RefCell < HashMap < i64 , ArcStr > > =
1004
1004
RefCell :: new ( HashMap :: default ( ) ) ;
1005
1005
let inner_source_index: RefCell < i64 > = RefCell :: new ( -2 ) ;
@@ -1224,7 +1224,7 @@ pub fn stream_chunks_of_combined_source_map(
1224
1224
if name. as_ref ( ) == original_name {
1225
1225
let mut name_index_mapping = name_index_mapping. borrow_mut ( ) ;
1226
1226
final_name_index =
1227
- name_index_mapping. get ( & name_index) . copied ( ) . unwrap_or ( -2 ) ;
1227
+ name_index_mapping. get ( name_index as usize ) . copied ( ) . unwrap_or ( -2 ) ;
1228
1228
if final_name_index == -2 {
1229
1229
if let Some ( name) =
1230
1230
name_index_value_mapping. get ( & name_index)
@@ -1240,7 +1240,7 @@ pub fn stream_chunks_of_combined_source_map(
1240
1240
} else {
1241
1241
final_name_index = -1 ;
1242
1242
}
1243
- name_index_mapping. insert ( name_index, final_name_index) ;
1243
+ name_index_mapping. insert ( name_index as usize , final_name_index) ;
1244
1244
}
1245
1245
}
1246
1246
}
@@ -1276,7 +1276,7 @@ pub fn stream_chunks_of_combined_source_map(
1276
1276
return ;
1277
1277
} else {
1278
1278
let mut source_index_mapping = source_index_mapping. borrow_mut ( ) ;
1279
- if source_index_mapping. get ( & source_index) == Some ( & -2 ) {
1279
+ if source_index_mapping. get ( source_index as usize ) == Some ( & -2 ) {
1280
1280
let mut source_mapping = source_mapping. borrow_mut ( ) ;
1281
1281
let mut global_index =
1282
1282
source_mapping. get ( inner_source_name) . copied ( ) ;
@@ -1290,15 +1290,14 @@ pub fn stream_chunks_of_combined_source_map(
1290
1290
) ;
1291
1291
global_index = Some ( len) ;
1292
1292
}
1293
- source_index_mapping
1294
- . insert ( source_index, global_index. unwrap ( ) as i64 ) ;
1293
+ source_index_mapping. insert ( source_index as usize , global_index. unwrap ( ) as i64 ) ;
1295
1294
}
1296
1295
}
1297
1296
}
1298
1297
1298
+ let source_index_mapping = source_index_mapping. borrow ( ) ;
1299
1299
let final_source_index = source_index_mapping
1300
- . borrow ( )
1301
- . get ( & source_index)
1300
+ . get ( source_index as usize )
1302
1301
. copied ( )
1303
1302
. unwrap_or ( -1 ) ;
1304
1303
if final_source_index < 0 {
@@ -1315,7 +1314,7 @@ pub fn stream_chunks_of_combined_source_map(
1315
1314
// Pass through the chunk with mapping
1316
1315
let mut name_index_mapping = name_index_mapping. borrow_mut ( ) ;
1317
1316
let mut final_name_index =
1318
- name_index_mapping. get ( & name_index) . copied ( ) . unwrap_or ( -1 ) ;
1317
+ name_index_mapping. get ( name_index as usize ) . copied ( ) . unwrap_or ( -1 ) ;
1319
1318
if final_name_index == -2 {
1320
1319
let name_index_value_mapping = name_index_value_mapping. borrow ( ) ;
1321
1320
let name = name_index_value_mapping. get ( & name_index) . unwrap ( ) ;
@@ -1327,7 +1326,7 @@ pub fn stream_chunks_of_combined_source_map(
1327
1326
global_index = Some ( len) ;
1328
1327
}
1329
1328
final_name_index = global_index. unwrap ( ) as i64 ;
1330
- name_index_mapping. insert ( name_index, final_name_index) ;
1329
+ name_index_mapping. insert ( name_index as usize , final_name_index) ;
1331
1330
}
1332
1331
on_chunk (
1333
1332
chunk,
@@ -1356,7 +1355,7 @@ pub fn stream_chunks_of_combined_source_map(
1356
1355
} else {
1357
1356
* inner_source = source_content. clone ( ) ;
1358
1357
}
1359
- source_index_mapping. borrow_mut ( ) . insert ( i, -2 ) ;
1358
+ source_index_mapping. borrow_mut ( ) . insert ( i as usize , -2 ) ;
1360
1359
stream_chunks_of_source_map (
1361
1360
& source_content. unwrap ( ) ,
1362
1361
inner_source_map,
@@ -1446,12 +1445,12 @@ pub fn stream_chunks_of_combined_source_map(
1446
1445
}
1447
1446
source_index_mapping
1448
1447
. borrow_mut ( )
1449
- . insert ( i, global_index. unwrap ( ) as i64 ) ;
1448
+ . insert ( i as usize , global_index. unwrap ( ) as i64 ) ;
1450
1449
}
1451
1450
} ,
1452
1451
& mut |i, name| {
1453
1452
let i = i as i64 ;
1454
- name_index_mapping. borrow_mut ( ) . insert ( i, -2 ) ;
1453
+ name_index_mapping. borrow_mut ( ) . insert ( i as usize , -2 ) ;
1455
1454
name_index_value_mapping. borrow_mut ( ) . insert ( i, name. into ( ) ) ;
1456
1455
} ,
1457
1456
options,
0 commit comments