MCPcopy Create free account
hub / github.com/Vector35/binaryninja-api / to_resolved

Method to_resolved

plugins/pdb-ng/src/struct_grouper.rs:268–302  ·  view source on GitHub ↗
(mut self)

Source from the content-addressed store, hash-verified

266 }
267
268 pub fn to_resolved(mut self) -> ResolvedGroup {
269 if let Some(index) = self.index {
270 ResolvedGroup::Single(index)
271 } else if self.is_union {
272 if self.children.len() == 1 {
273 self.children.remove(0).to_resolved()
274 } else {
275 // Collapse union of unions
276 ResolvedGroup::Union(
277 self.offset,
278 self.children
279 .into_iter()
280 .flat_map(|child| match child.to_resolved() {
281 ResolvedGroup::Union(offset, children) if offset == self.offset => {
282 children
283 }
284 s => vec![s],
285 })
286 .collect(),
287 )
288 }
289 } else {
290 if self.children.len() == 1 {
291 self.children.remove(0).to_resolved()
292 } else {
293 ResolvedGroup::Struct(
294 self.offset,
295 self.children
296 .into_iter()
297 .map(|child| child.to_resolved())
298 .collect(),
299 )
300 }
301 }
302 }
303}
304
305pub fn group_structure(

Callers 1

resolve_struct_groupsFunction · 0.80

Calls 4

mapMethod · 0.80
lenMethod · 0.45
removeMethod · 0.45
into_iterMethod · 0.45

Tested by

no test coverage detected