luaur_analysis/methods/
dfg_scope_lookup_data_flow_graph_alt_b.rs1use crate::records::dfg_scope::DfgScope;
2use crate::type_aliases::def_id_def::DefId;
3use alloc::string::String;
4
5impl DfgScope {
6 pub fn lookup_def_id_string(&self, def: DefId, key: &String) -> Option<DefId> {
7 let mut current: Option<&DfgScope> = Some(self);
12 while let Some(scope) = current {
13 if let Some(props) = scope.props.find(&def) {
14 if let Some(value) = props.get(key) {
15 return Some(*value);
16 }
17 }
18 current = unsafe { scope.parent.as_ref() };
19 }
20 None
21 }
22}