Unfortunately, converting snippets is only as accurate as the snippet context. In this case, there are several variables in the snippet that seem to be defined in another scope. Assuming those variables exist, the output from the Code Converter is mostly correct:
size - 1
If you have specific errors, let us know so we can try to help.