]> code.delx.au - gnu-emacs/blobdiff - src/vm-limit.c
Simplify recording of main thread's ID on MS-Windows
[gnu-emacs] / src / vm-limit.c
index ab102e32623321ca3d2a12bf36eb4a51d61635f1..503aaaebf8a1667739b81bf64aca810f99630173 100644 (file)
@@ -170,19 +170,13 @@ check_memory_limits (void)
   if (new_warnlevel > warnlevel || new_warnlevel == warned_95)
     {
       warnlevel = new_warnlevel;
-      switch (warnlevel)
+      static char const *const warn_diagnostic[] =
        {
-       case warned_75:
-         (*warn_function) ("Warning: past 75% of memory limit");
-         break;
-
-       case warned_85:
-         (*warn_function) ("Warning: past 85% of memory limit");
-         break;
-
-       case warned_95:
-         (*warn_function) ("Warning: past 95% of memory limit");
-       }
+         "Warning: past 75% of memory limit",
+         "Warning: past 85% of memory limit",
+         "Warning: past 95% of memory limit"
+       };
+      warn_function (warn_diagnostic[warnlevel - 1]);
     }
   /* Handle going down in usage levels, with some hysteresis.  */
   else