Skip to content

Commit 0327b02

Browse files
committed
Fix variable name in Object Pool
Changed _framesLeft to framesLeft_ Now it follows naming pattern and matches variable from code snippets.
1 parent a291c67 commit 0327b02

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

book/object-pool.markdown

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ called once per frame.
252252

253253
The pool needs to know which particles are available for reuse. It gets this
254254
from the particle's `inUse()` function. This function takes advantage of the fact that
255-
particles have a limited lifetime and uses the `_framesLeft` variable to
255+
particles have a limited lifetime and uses the `framesLeft_` variable to
256256
discover which particles are in use without having to store a separate flag.
257257

258258
The pool class is also simple:
@@ -319,7 +319,7 @@ the data for the unused particles themselves.
319319

320320
When a particle isn't in use, most of its state is irrelevant. Its position and
321321
velocity aren't being used. The only state it needs is the stuff required to
322-
tell if it's dead. In our example, that's the `_framesLeft` member. All those
322+
tell if it's dead. In our example, that's the `framesLeft_` member. All those
323323
other bits can be reused. Here's a revised particle:
324324

325325
^code 4

0 commit comments

Comments
 (0)