Skip to content

Commit

Permalink
Use identity (not structural) comparison to compare objects (+10%).
Browse files Browse the repository at this point in the history
  • Loading branch information
mfp committed Mar 25, 2009
1 parent 44b4597 commit d9c978c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion rayTracer.ml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ object (__)
(* send shadow ray; if unshadowed, get inward emission value *)
let emissionIn = match scene_m#intersection surfacePoint#position
emitDirection (Some surfacePoint#hitObject) with
Some (hitObject, _) when hitObject <> emitter -> vZero
Some (hitObject, _) when hitObject != emitter -> vZero
| _ -> (new SurfacePoint.obj emitter emitterPosition)#emission
surfacePoint#position ~-|emitDirection true in

Expand Down
2 changes: 1 addition & 1 deletion spatialIndex.ml
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ let rec intersection octree rayOrigin rayDirection ?(start = rayOrigin)
(* define nearest-finder *)
let findNearest nearest item = match lastHit with
(* avoid false intersection with surface just come from *)
Some it when it = item -> nearest
Some it when it == item -> nearest
| _ ->
let _, _, nearestDistance = nearest in

Expand Down

0 comments on commit d9c978c

Please sign in to comment.