translate.c: Some minor code tweaks.
authorRichard Mudgett <rmudgett@digium.com>
Tue, 15 Oct 2013 23:44:11 +0000 (23:44 +0000)
committerRichard Mudgett <rmudgett@digium.com>
Tue, 15 Oct 2013 23:44:11 +0000 (23:44 +0000)
commitef7c5a04c01e59fa6e53a199c5aafa59c88ee7ab
tree6a1266a6a3ddf0f5b1529325b80f47568d45fb7d
parent66e7dc041d3c69f2f5e793e113d0d017005ab36d
translate.c: Some minor code tweaks.

* Consistently compare format2index() return value so matrix_get() cannot
get passed negative values.

* Optimize ast_translator_best_choice() to defer initializing things until
needed.  Also cached the matrix_get() return value rather than repeatedly
calling it.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@401039 65c4cc65-6c06-0410-ace0-fbb531ad65f3
main/translate.c