Updated, although 1) this is a private function and 2) the return value isn't even used anywhere (I only added it for parity with other languages' APIs).