optimal array_get