Rewrite for better efficiency

uses a single, more concise statement rather than an if statement, and
checks buildLimit before attempting to check if the buildables cache
contains the key.