mirror of
https://github.com/erg-lang/erg.git
synced 2025-08-04 10:49:54 +00:00
chore: remove unnecessary params
This commit is contained in:
parent
1deb0c4788
commit
5c6ea316f5
13 changed files with 220 additions and 372 deletions
|
@ -261,7 +261,6 @@ pub fn __array_getitem__(mut args: ValueArgs, ctx: &Context) -> EvalValueResult<
|
|||
}
|
||||
|
||||
pub fn __dict_getitem__(mut args: ValueArgs, ctx: &Context) -> EvalValueResult<ValueObj> {
|
||||
let allow_cast = true;
|
||||
let slf = args.remove_left_or_key("Self").unwrap();
|
||||
let slf = enum_unwrap!(slf, ValueObj::Dict);
|
||||
let index = args.remove_left_or_key("Index").unwrap();
|
||||
|
@ -269,7 +268,7 @@ pub fn __dict_getitem__(mut args: ValueArgs, ctx: &Context) -> EvalValueResult<V
|
|||
for (k, v) in slf.iter() {
|
||||
match (&index, k) {
|
||||
(ValueObj::Type(idx), ValueObj::Type(kt)) => {
|
||||
if ctx.subtype_of(idx.typ(), kt.typ(), allow_cast) {
|
||||
if ctx.subtype_of(idx.typ(), kt.typ()) {
|
||||
return Some(v);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue