Quick optimization.
authorRyan C. Gordon <icculus@icculus.org>
Tue, 24 Feb 2009 02:57:47 -0500
changeset 698 a6cd16b3e270
parent 697 765a85a989a2
child 699 c2f50b391d96
Quick optimization.
mojoshader_preprocessor.c
--- a/mojoshader_preprocessor.c	Tue Feb 24 02:04:05 2009 -0500
+++ b/mojoshader_preprocessor.c	Tue Feb 24 02:57:47 2009 -0500
@@ -529,6 +529,9 @@
                        unsigned int srclen, unsigned int linenum,
                        MOJOSHADER_includeClose close_callback, Define *defs)
 {
+    if (srclen == 0)
+        return 1;  // nothing to do: just pretend you did it.
+
     IncludeState *state = get_include(ctx);
     if (state == NULL)
         return 0;