mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-23 11:41:45 +00:00
update n-body for comparison
This commit is contained in:
@ -96,7 +96,7 @@ class NBodySystem {
|
||||
py += b.vy * m;
|
||||
pz += b.vz * m;
|
||||
}
|
||||
bodies[0].offsetMomentum(px, py, pz);
|
||||
unchecked(bodies[0]).offsetMomentum(px, py, pz);
|
||||
}
|
||||
|
||||
advance(dt: float): void {
|
||||
@ -206,5 +206,5 @@ export function bench(steps: u32): void {
|
||||
|
||||
export function getBody(index: i32): Body | null {
|
||||
var bodies = system.bodies;
|
||||
return <u32>index < <u32>bodies.length ? bodies[index] : null;
|
||||
return <u32>index < <u32>bodies.length ? unchecked(bodies[index]) : null;
|
||||
}
|
||||
|
Reference in New Issue
Block a user