shithub: sox

Download patch

ref: 5bff6d2f408ac3975819f7c5f450f6505eb229ae
parent: 1573e88a2d2003efd10ef5924db5ec1bbcf5d238
author: cbagwell <cbagwell>
date: Sat Feb 19 14:42:20 EST 2011

Small performance improvement for absolute paths that aren't found.

--- a/src/win32-ltdl.c
+++ b/src/win32-ltdl.c
@@ -84,6 +84,12 @@
 
     for (iPath = 0; !hMod && iPath < MAX_SEARCH_PATHS; iPath++)
     {
+	/* Only loop through 1 time when user gives absolute paths
+	 * to prevent wasting time.
+	 */
+	if (iPath > 0 && (szFileName[0] != '/' || szFileName[0] != '\\'))
+	    break;
+
 	/* Add search path only if non-empty and filename does not
 	 * contain absolute path.
 	 */