[PATCH] Move recursive nested function to file scope.