Skip to content

Commit

Permalink
use deque
Browse files Browse the repository at this point in the history
  • Loading branch information
fogleman committed Apr 6, 2013
1 parent f0686c6 commit 87d3b48
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import random
import time

from collections import deque
from pyglet import image
from pyglet.gl import *
from pyglet.graphics import TextureGroup
Expand Down Expand Up @@ -127,7 +128,7 @@ def __init__(self):

# Simple function queue implementation. The queue is populated with
# _show_block() and _hide_block() calls
self.queue = []
self.queue = deque()

self._initialize()

Expand Down Expand Up @@ -385,7 +386,7 @@ def _dequeue(self):
""" Pop the top function from the internal queue and call it.
"""
func, args = self.queue.pop(0)
func, args = self.queue.popleft()
func(*args)

def process_queue(self):
Expand Down

0 comments on commit 87d3b48

Please sign in to comment.