dev/jenkinsfile (#10)
Reviewed-on: #10 Co-authored-by: bQUARKz <bquarkz@gmail.com> Co-committed-by: bQUARKz <bquarkz@gmail.com>
This commit was merged in pull request #10.
This commit is contained in:
@@ -197,7 +197,7 @@ impl NativeInterface for VirtualMachineRuntime {
|
||||
let pan_raw = expect_int(args, 3)?;
|
||||
let pitch = expect_number(args, 4, "pitch")?;
|
||||
|
||||
if voice_id_raw < 0 || voice_id_raw >= 16 {
|
||||
if !(0..16).contains(&voice_id_raw) {
|
||||
ret.push_int(AudioOpStatus::VoiceInvalid as i64);
|
||||
return Ok(());
|
||||
}
|
||||
@@ -238,7 +238,7 @@ impl NativeInterface for VirtualMachineRuntime {
|
||||
_ => prometeu_hal::LoopMode::On,
|
||||
};
|
||||
|
||||
if voice_id_raw < 0 || voice_id_raw >= 16 {
|
||||
if !(0..16).contains(&voice_id_raw) {
|
||||
ret.push_int(AudioOpStatus::VoiceInvalid as i64);
|
||||
return Ok(());
|
||||
}
|
||||
@@ -558,7 +558,7 @@ fn hex_decode(s: &str) -> Result<Vec<u8>, VmFault> {
|
||||
}
|
||||
|
||||
let bytes = s.as_bytes();
|
||||
if bytes.len() % 2 != 0 {
|
||||
if !bytes.len().is_multiple_of(2) {
|
||||
return Err(VmFault::Trap(TRAP_TYPE, "payload_hex must have even length".to_string()));
|
||||
}
|
||||
let mut out = Vec::with_capacity(bytes.len() / 2);
|
||||
|
||||
Reference in New Issue
Block a user