File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ use crate::*;
11
11
#[ derive( Default , Debug ) ]
12
12
pub struct Stats < ' a > {
13
13
pub operators : FxHashMap < u16 , u64 > ,
14
- pub operands : FxHashMap < & ' a str , u64 > ,
14
+ pub operands : FxHashMap < & ' a [ u8 ] , u64 > ,
15
15
}
16
16
17
17
impl Serialize for Stats < ' _ > {
@@ -120,9 +120,9 @@ where
120
120
fn compute < ' a > ( _node : & Node < ' a > , _code : & ' a [ u8 ] , _stats : & mut Stats < ' a > ) { }
121
121
}
122
122
123
- fn get_id < ' a > ( node : & Node < ' a > , code : & ' a [ u8 ] ) -> & ' a str {
124
- let code = & code [ node . start_byte ( ) ..node . end_byte ( ) ] ;
125
- std :: str :: from_utf8 ( code) . unwrap ( )
123
+ # [ inline ( always ) ]
124
+ fn get_id < ' a > ( node : & Node < ' a > , code : & ' a [ u8 ] ) -> & ' a [ u8 ] {
125
+ & code[ node . start_byte ( ) ..node . end_byte ( ) ]
126
126
}
127
127
128
128
impl Halstead for PythonCode {
You can’t perform that action at this time.
0 commit comments