View Single Post
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 09-04-2017 , 14:24   Re: REST in Pawn - Communicate with JSON REST APIs
Reply With Quote #29

Quote:
Originally Posted by splewis View Post
Given an arbitrary adt array it's possible to prevent going out of bounds with a Length check.

Given an arbitrary adt trie it's not possible to prevent a lookup to a non-existing key based on any check - thus the lookups need to be safe.
This is exactly it.

(Yes, a KeyExists function and throwing on invalid keys would also be suitable for the error model, but you pay the hash and lookup penalty twice, so it is simpler in that case to do in one go.)
__________________
asherkin is offline