Skip to content

Commit

Permalink
Optimized and fixed frame 0 bug with iFRP.
Browse files Browse the repository at this point in the history
Former-commit-id: ceccd36
  • Loading branch information
bryanedds committed Aug 17, 2016
1 parent 95e9696 commit c112382
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions Nu/Nu/Nu/WorldStream.fs
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ module Stream =
let [<DebuggerHidden; DebuggerStepThrough>] noMoreThanOncePerUpdate (stream : Stream<'a, World>) =
stream |>
track4
(fun (a, (_, current)) _ world ->
(fun (a, current) _ world ->
let previous = current
let current = World.getUpdateCount world
((a, (previous, current)), previous < current))
id (Unchecked.defaultof<'a>, (0L, 0L)) |>
((a, current), previous < current))
id (Unchecked.defaultof<'a>, -1L) |>
first

/// Take events from an stream only while World.isTicking evaluates to true.
Expand Down
8 changes: 4 additions & 4 deletions Nu/Nu/Nu/WorldTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ module WorldTests =
let world = World.createEntity typeof<EntityDispatcher>.Name None (Some Bob.EntityName) Simulants.DefaultGroup world |> snd
let world =
world |>
Bob.TagVisible -!> Jim.TagVisible |>
Jim.TagVisible -/> Bob.TagVisible.MapSet not
let world = Bob.SetVisible false world
Assert.True ^ Bob.GetVisible world
Bob.TagVisible -!> Jim.TagVisible.MapSet not |>
Jim.TagVisible -/> Bob.TagVisible
let world = Bob.SetVisible true world
Assert.False ^ Bob.GetVisible world
Assert.True ^ Jim.GetVisible world
2 changes: 1 addition & 1 deletion Prime/Prime/Prime/Stream.fs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ type [<NoEquality; NoComparison>] PropertyTag<'s, 'a, 'w> =
{ this with Get = mapper this.Get }

member this.MapSet mapper =
{ this with OptSet = match this.OptSet with Some set -> Some ^ (fun value -> set ^ mapper value) | None -> None }
{ this with OptSet = match this.OptSet with Some set -> Some (fun value -> set (mapper value)) | None -> None }

[<RequireQualifiedAccess; CompilationRepresentation (CompilationRepresentationFlags.ModuleSuffix)>]
module PropertyTag =
Expand Down

0 comments on commit c112382

Please sign in to comment.