Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/lib/libcurses/director tests/libcurses: don't waste ti...



details:   https://anonhg.NetBSD.org/src/rev/c9abd28001d2
branches:  trunk
changeset: 954347:c9abd28001d2
user:      rillig <rillig%NetBSD.org@localhost>
date:      Tue Apr 06 00:35:58 2021 +0000

description:
tests/libcurses: don't waste time calling strlen needlessly

diffstat:

 tests/lib/libcurses/director/testlang_parse.y |  5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diffs (20 lines):

diff -r f42f0e2c4c33 -r c9abd28001d2 tests/lib/libcurses/director/testlang_parse.y
--- a/tests/lib/libcurses/director/testlang_parse.y     Mon Apr 05 23:01:55 2021 +0000
+++ b/tests/lib/libcurses/director/testlang_parse.y     Tue Apr 06 00:35:58 2021 +0000
@@ -1,5 +1,5 @@
 %{
-/*     $NetBSD: testlang_parse.y,v 1.49 2021/02/15 15:55:50 joerg Exp $        */
+/*     $NetBSD: testlang_parse.y,v 1.50 2021/04/06 00:35:58 rillig Exp $       */
 
 /*-
  * Copyright 2009 Brett Lymn <blymn%NetBSD.org@localhost>
@@ -876,8 +876,7 @@
        int i;
 
        for (i = 0; i < nfunctions; i++) {
-               if ((strlen(function) == strlen(table[i])) &&
-                   (strcmp(function, table[i]) == 0))
+               if (strcmp(function, table[i]) == 0)
                        return 1;
        }
 



Home | Main Index | Thread Index | Old Index