From a8076c04f730482dda531a3fe32afa6c9f8467b2 Mon Sep 17 00:00:00 2001 From: Jacek Suliga Date: Tue, 28 Nov 2017 12:32:59 -0800 Subject: [PATCH] Fixing build warning for an impossible condition check --- Hakawai/Mentions/HKWMentionsPlugin.m | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/Hakawai/Mentions/HKWMentionsPlugin.m b/Hakawai/Mentions/HKWMentionsPlugin.m index 7451929..2c17767 100644 --- a/Hakawai/Mentions/HKWMentionsPlugin.m +++ b/Hakawai/Mentions/HKWMentionsPlugin.m @@ -1258,16 +1258,9 @@ - (void)advanceStateForInsertionChanged:(unichar)precedingChar case HKWMentionsStateQuiescent: { NSRange mentionRange; HKWMentionsAttribute *precedingMention = nil; - if (location >= 0) { - // Look for a preceding mention, but only if we're at the beginning of the text range - precedingMention = [self mentionAttributePrecedingLocation:location - range:&mentionRange]; - } - else { - NSAssert(precedingChar == (unichar)0, - @"Logic error: at beginning of document, but preceding character is not null"); - return; - } + // Look for a preceding mention, but only if we're at the beginning of the text range + precedingMention = [self mentionAttributePrecedingLocation:location + range:&mentionRange]; if (precedingMention) { // A mention was found. self.currentlySelectedMention = precedingMention;