[gnome-builder] pattern-spec: avoid unnecessary forward walking on last item
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] pattern-spec: avoid unnecessary forward walking on last item
- Date: Wed, 22 Apr 2015 19:08:06 +0000 (UTC)
commit e82158fd0547fe0763eaa8aee0d54765173b65ab
Author: Christian Hergert <christian hergert me>
Date: Wed Apr 22 12:08:00 2015 -0700
pattern-spec: avoid unnecessary forward walking on last item
Save a few cycles trying to find the next word start if we are on the
last item in the array.
libide/ide-pattern-spec.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/libide/ide-pattern-spec.c b/libide/ide-pattern-spec.c
index 0a2ea97..36660e4 100644
--- a/libide/ide-pattern-spec.c
+++ b/libide/ide-pattern-spec.c
@@ -134,7 +134,8 @@ ide_pattern_spec_match (IdePatternSpec *self,
if (haystack == NULL)
return FALSE;
- haystack = next_word_start (haystack + strlen (self->parts [i]));
+ if (self->parts [i + 1] != NULL)
+ haystack = next_word_start (haystack + strlen (self->parts [i]));
}
return TRUE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]