I think my algorithm may not that efficient, is there a way to improve it?

```
int reverse(int a)
{
int testNum;
int digit;
string number;
if (a < 0)
{
testNum = -a;
}
else
{
testNum = a;
}
int index = 0;
while (testNum != 0)
{
digit = testNum % 10;
if (digit != 0 || number.size())
{
number += ('0' + digit);
index++;
}
testNum /= 10;
}
int result = atoi(number.c_str());
if (a < 0)
{
result = -result;
}
return result;
}
```