chore: Use `get_f64` for `NetStream.seek`

This commit is contained in:
David Wendt 2023-09-16 12:50:41 -04:00 committed by kmeisthax
parent 99de1ae154
commit 3f13087d39
1 changed files with 1 additions and 5 deletions

View File

@ -123,11 +123,7 @@ pub fn seek<'gc>(
args: &[Value<'gc>],
) -> Result<Value<'gc>, Error<'gc>> {
if let Some(ns) = this.as_netstream() {
let offset = args
.get(0)
.cloned()
.unwrap_or(Value::Undefined)
.coerce_to_number(activation)?;
let offset = args.get_f64(activation, 0)?;
ns.seek(&mut activation.context, offset);
}