Skip to content

Commit

Permalink
Update CLA allowlist (#1730)
Browse files Browse the repository at this point in the history
  • Loading branch information
orez- authored Nov 17, 2023
1 parent c2db7e6 commit dcf3256
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cla.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
remote-repository-name: cla-signatures
path-to-signatures: individual.json
branch: main
allowlist: djanatyn,gj,gneray,jedgresham,killpack,laxjesse,patrickod,samscott89,ssglaser,uncommoncense,vrama628,dependabot,dependabot[bot]
allowlist: djanatyn,edaniels,gj,gneray,gsarjeant,jedgresham,killpack,laxjesse,orez-,samscott89,ssglaser,sverch,uncommoncense,vrama628,dependabot,dependabot[bot]
use-dco-flag: false
create-file-commit-message: 'Creating file for storing CLA signatures'
signed-commit-message: '$contributorName has signed the CLA in osohq/oso#$pullRequestNo'
Expand Down
4 changes: 3 additions & 1 deletion polar-c-api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,9 @@ pub extern "C" fn string_free(s: *mut c_char) -> i32 {
if s.is_null() {
return POLAR_FAILURE;
}
unsafe { CString::from_raw(s) };
unsafe {
let _ = CString::from_raw(s);
};
POLAR_SUCCESS
}

Expand Down
10 changes: 4 additions & 6 deletions polar-core/src/data_filtering.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,9 +211,8 @@ impl VarInfo {
}

fn do_and(self, args: &[Term]) -> PolarResult<Self> {
args.iter().fold(Ok(self), |this, arg| {
this?.process_exp(arg.as_expression()?)
})
args.iter()
.try_fold(self, |this, arg| this.process_exp(arg.as_expression()?))
}

fn do_dot(mut self, lhs: &Term, rhs: &Term) -> Self {
Expand Down Expand Up @@ -795,8 +794,7 @@ impl<'a> ResultSetBuilder<'a> {
fn constrain_fields(&mut self, id: Id, var_type: &str) -> PolarResult<&mut Self> {
match self.vars.field_relationships.get(&id) {
None => Ok(self),
Some(fs) => fs.iter().fold(Ok(self), |this, (field, child)| {
let this = this?;
Some(fs) => fs.iter().try_fold(self, |this, (field, child)| {
match this.types.get(var_type).and_then(|m| m.get(field)) {
None => df_field_missing(var_type, field),
Some(Type::Relation {
Expand Down Expand Up @@ -991,7 +989,7 @@ where
A: Eq + Hash,
B: Eq + Hash,
{
map.entry(a).or_insert_with(HashSet::new).insert(b);
map.entry(a).or_default().insert(b);
map
}

Expand Down
2 changes: 1 addition & 1 deletion polar-core/src/formatting.rs
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ mod to_polar {
if args.is_empty() {
kwargs
} else {
vec![args, kwargs].join(", ")
[args, kwargs].join(", ")
}
}
None => args,
Expand Down
10 changes: 5 additions & 5 deletions polar-core/src/lexer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -518,14 +518,14 @@ mod tests {
lexer.next(),
Some(Ok((_, Token::Integer(123), _)))
));
assert!(matches!(lexer.next(), None));
assert!(lexer.next().is_none());
let s = "123 #comment";
let mut lexer = Lexer::new(s);
assert!(matches!(
lexer.next(),
Some(Ok((_, Token::Integer(123), _)))
));
assert!(matches!(lexer.next(), None));
assert!(lexer.next().is_none());
}

#[test]
Expand Down Expand Up @@ -595,14 +595,14 @@ mod tests {
assert!(
matches!(lexer.next(), Some(Ok((4, Token::Symbol(x), 7))) if x == Symbol::new("bar"))
);
assert!(matches!(lexer.next(), None));
assert!(lexer.next().is_none());

let s = "foo::bar";
let mut lexer = Lexer::new(s);
assert!(
matches!(lexer.next(), Some(Ok((0, Token::Symbol(x), 8))) if x == Symbol::new("foo::bar"))
);
assert!(matches!(lexer.next(), None));
assert!(lexer.next().is_none());

let s = "foo:::bar";
let mut lexer = Lexer::new(s);
Expand Down Expand Up @@ -651,7 +651,7 @@ mod tests {
assert!(
matches!(lexer.next(), Some(Ok((66, Token::Symbol(ruby_namespace), 81))) if ruby_namespace == Symbol::new("Ruby::Namespace"))
);
assert!(matches!(lexer.next(), None));
assert!(lexer.next().is_none());
}

#[test]
Expand Down
4 changes: 2 additions & 2 deletions polar-core/src/partial/simplify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -286,8 +286,8 @@ impl PerfCounters {
return;
}

self.simplify_term.extend(other.simplify_term.into_iter());
self.preprocess_and.extend(other.preprocess_and.into_iter());
self.simplify_term.extend(other.simplify_term);
self.preprocess_and.extend(other.preprocess_and);
}

pub fn is_enabled(&self) -> bool {
Expand Down
10 changes: 5 additions & 5 deletions polar-core/src/rules.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ impl RuleTypes {
pub fn add(&mut self, rule_type: Rule) {
let name = rule_type.name.clone();
// get rule types with this rule name
let rule_types = self.0.entry(name).or_insert_with(Vec::new);
let rule_types = self.0.entry(name).or_default();
rule_types.push(rule_type);
}

Expand Down Expand Up @@ -161,7 +161,7 @@ impl RuleIndex {
None
}
})
.or_insert_with(RuleIndex::default)
.or_default()
.index_rule(rule_id, params, i + 1);
} else {
self.rules.insert(rule_id);
Expand All @@ -180,8 +180,8 @@ impl RuleIndex {
let mut ruleset = self
.index
.get(&Some(arg.clone()))
.map(|index| filter_next_args(index))
.unwrap_or_else(RuleSet::default);
.map(filter_next_args)
.unwrap_or_default();

// Extend for a variable parameter.
if let Some(index) = self.index.get(&None) {
Expand All @@ -193,7 +193,7 @@ impl RuleIndex {
self.index.values().fold(
RuleSet::default(),
|mut result: RuleSet, index: &RuleIndex| {
result.extend(filter_next_args(index).into_iter());
result.extend(filter_next_args(index));
result
},
)
Expand Down
4 changes: 2 additions & 2 deletions polar-core/src/vm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -832,7 +832,7 @@ impl PolarVirtualMachine {
trace = trace_stack
.pop()
.map(|ts| ts.as_ref().clone())
.unwrap_or_else(Vec::new);
.unwrap_or_default();
}

stack.reverse();
Expand Down Expand Up @@ -1261,7 +1261,7 @@ impl PolarVirtualMachine {
});

let mut add_constraints = vec![type_constraint];
add_constraints.extend(field_constraints.into_iter());
add_constraints.extend(field_constraints);

// Run compatibility check.
self.choose_conditional(
Expand Down

1 comment on commit dcf3256

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rust Benchmark

Benchmark suite Current: dcf3256 Previous: c2db7e6 Ratio
rust_get_attribute 28809 ns/iter (± 1057) 57323 ns/iter (± 5058) 0.50
n_plus_one/100 1527251 ns/iter (± 26136) 2631810 ns/iter (± 73846) 0.58
n_plus_one/500 7387941 ns/iter (± 235574) 11965474 ns/iter (± 563699) 0.62
n_plus_one/1000 14724366 ns/iter (± 100504) 24055373 ns/iter (± 1422146) 0.61
unify_once 623 ns/iter (± 310) 1041 ns/iter (± 98) 0.60
unify_twice 1729 ns/iter (± 19) 2771 ns/iter (± 164) 0.62
many_rules 38800 ns/iter (± 897) 65550 ns/iter (± 3916) 0.59
fib/5 347384 ns/iter (± 14919) 612818 ns/iter (± 37374) 0.57
prime/3 10343 ns/iter (± 371) 20796 ns/iter (± 1717) 0.50
prime/23 10348 ns/iter (± 447) 20032 ns/iter (± 2672) 0.52
prime/43 10354 ns/iter (± 411) 20219 ns/iter (± 2056) 0.51
prime/83 10352 ns/iter (± 373) 20194 ns/iter (± 2030) 0.51
prime/255 9322 ns/iter (± 407) 18499 ns/iter (± 2712) 0.50
indexed/100 3470 ns/iter (± 343) 6737 ns/iter (± 1963) 0.52
indexed/500 4039 ns/iter (± 1232) 8512 ns/iter (± 2164) 0.47
indexed/1000 4449 ns/iter (± 583) 10890 ns/iter (± 6260) 0.41
indexed/10000 8619 ns/iter (± 2404) 27800 ns/iter (± 3928) 0.31
not 4091 ns/iter (± 53) 6685 ns/iter (± 1099) 0.61
double_not 8592 ns/iter (± 136) 13567 ns/iter (± 734) 0.63
De_Morgan_not 5524 ns/iter (± 90) 8709 ns/iter (± 591) 0.63
load_policy 686829 ns/iter (± 18889) 1033542 ns/iter (± 35879) 0.66
partial_and/1 20972 ns/iter (± 596) 38903 ns/iter (± 7388) 0.54
partial_and/5 69048 ns/iter (± 1898) 134046 ns/iter (± 11232) 0.52
partial_and/10 130161 ns/iter (± 5133) 254283 ns/iter (± 14726) 0.51
partial_and/20 271864 ns/iter (± 5670) 508018 ns/iter (± 22493) 0.54
partial_and/40 594206 ns/iter (± 8587) 1096817 ns/iter (± 58806) 0.54
partial_and/80 1376997 ns/iter (± 8731) 2526924 ns/iter (± 199761) 0.54
partial_and/100 1837192 ns/iter (± 9679) 3474494 ns/iter (± 218315) 0.53
partial_rule_depth/1 62922 ns/iter (± 2472) 125380 ns/iter (± 7215) 0.50
partial_rule_depth/5 216087 ns/iter (± 6460) 415336 ns/iter (± 32806) 0.52
partial_rule_depth/10 489765 ns/iter (± 9052) 933282 ns/iter (± 50029) 0.52
partial_rule_depth/20 1401071 ns/iter (± 16223) 2709255 ns/iter (± 104547) 0.52
partial_rule_depth/40 5029401 ns/iter (± 44483) 10651977 ns/iter (± 813375) 0.47
partial_rule_depth/80 28165898 ns/iter (± 269002) 66451256 ns/iter (± 3070164) 0.42
partial_rule_depth/100 50694029 ns/iter (± 1343711) 122329701 ns/iter (± 6298265) 0.41

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.