fizbin's solution seems to be faster than your one.
In reply to Re^2: Finding longest palindrome from a string by ccn in thread Finding longest palindrome from a string by BUU