File tree Expand file tree Collapse file tree 1 file changed +3
-10
lines changed
Expand file tree Collapse file tree 1 file changed +3
-10
lines changed Original file line number Diff line number Diff line change 11use std:: {
2- borrow:: Cow ,
32 fmt:: Display ,
43 hash:: { Hash , Hasher } ,
54 num:: TryFromIntError ,
@@ -157,6 +156,7 @@ impl LVar {
157156 }
158157 }
159158
159+ #[ inline( always) ]
160160 pub fn get < ' a > ( & ' a self , state : & ' a ProcessorState ) -> LValue {
161161 match self {
162162 Self :: Variable ( i) => state. variables [ * i] . clone ( ) ,
@@ -170,16 +170,8 @@ impl LVar {
170170 }
171171 }
172172
173- /// Returns `None` if this is a variable for which `self.set` would be a no-op.
174- pub fn try_get_writable < ' a > ( & ' a self , state : & ' a ProcessorState ) -> Option < Cow < ' a , LValue > > {
175- match self {
176- Self :: Variable ( i) => Some ( Cow :: Borrowed ( & state. variables [ * i] ) ) ,
177- Self :: Counter => Some ( Cow :: Owned ( state. counter . into ( ) ) ) ,
178- _ => None ,
179- }
180- }
181-
182173 /// Returns true if the variable was successfully set.
174+ #[ inline( always) ]
183175 pub fn set ( & self , state : & mut ProcessorState , value : LValue ) -> bool {
184176 match self {
185177 Self :: Variable ( i) => {
@@ -191,6 +183,7 @@ impl LVar {
191183 }
192184 }
193185
186+ #[ inline( always) ]
194187 pub fn set_from ( & self , state : & mut ProcessorState , other : & LVar ) {
195188 self . set ( state, other. get ( state) ) ;
196189 }
You can’t perform that action at this time.
0 commit comments