MCPcopy Create free account
hub / github.com/AmrDeveloper/GQL / equals

Method equals

crates/gitql-core/src/values/array.rs:54–73  ·  view source on GitHub ↗
(&self, other: &Box<dyn Value>)

Source from the content-addressed store, hash-verified

52 }
53
54 fn equals(&self, other: &Box<dyn Value>) -> bool {
55 if let Some(other_array) = other.as_any().downcast_ref::<ArrayValue>() {
56 if !self.base_type.equals(&other_array.base_type) {
57 return false;
58 }
59
60 let self_values = &self.values;
61 let other_values = &other_array.values;
62 if self.values.len() != other_values.len() {
63 return false;
64 }
65
66 for i in 0..self.values.len() {
67 if !self_values[i].equals(&other_values[i]) {
68 return false;
69 }
70 }
71 }
72 false
73 }
74
75 fn compare(&self, _other: &Box<dyn Value>) -> Option<Ordering> {
76 None

Callers 2

logical_or_opMethod · 0.45
contains_opMethod · 0.45

Calls 2

as_anyMethod · 0.45
lenMethod · 0.45

Tested by

no test coverage detected