Module Name: src Committed By: yamt Date: Tue May 26 22:38:18 UTC 2009
Modified Files: src/common/lib/libc/gen: rpst.c Log Message: rpst_iterate_first: fix a bug which causes unnecessary scan. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/common/lib/libc/gen/rpst.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/common/lib/libc/gen/rpst.c diff -u src/common/lib/libc/gen/rpst.c:1.6 src/common/lib/libc/gen/rpst.c:1.7 --- src/common/lib/libc/gen/rpst.c:1.6 Tue May 26 22:37:50 2009 +++ src/common/lib/libc/gen/rpst.c Tue May 26 22:38:18 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: rpst.c,v 1.6 2009/05/26 22:37:50 yamt Exp $ */ +/* $NetBSD: rpst.c,v 1.7 2009/05/26 22:38:18 yamt Exp $ */ /*- * Copyright (c)2009 YAMAMOTO Takashi, @@ -43,10 +43,10 @@ #include <sys/cdefs.h> #if defined(_KERNEL) -__KERNEL_RCSID(0, "$NetBSD: rpst.c,v 1.6 2009/05/26 22:37:50 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rpst.c,v 1.7 2009/05/26 22:38:18 yamt Exp $"); #include <sys/param.h> #else /* defined(_KERNEL) */ -__RCSID("$NetBSD: rpst.c,v 1.6 2009/05/26 22:37:50 yamt Exp $"); +__RCSID("$NetBSD: rpst.c,v 1.7 2009/05/26 22:38:18 yamt Exp $"); #include <assert.h> #include <stdbool.h> #include <string.h> @@ -379,6 +379,9 @@ if (n == NULL || n->n_y > max_y) { return NULL; } + if (rpst_height2max(t->t_height) < min_x) { + return NULL; + } it->it_tree = t; it->it_cur = n; it->it_idx = (min_x & rpst_startmask(t)) != 0;