From 8c924a0fa936548a0f92ff69e18c8041838be42b Mon Sep 17 00:00:00 2001 From: Said Achmiz Date: Tue, 5 Apr 2016 01:41:47 -0400 Subject: [PATCH] Change order of checking for operators; this should have no effect --- SA_DiceParser.m | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/SA_DiceParser.m b/SA_DiceParser.m index e46c439..3cb4f56 100644 --- a/SA_DiceParser.m +++ b/SA_DiceParser.m @@ -274,16 +274,16 @@ static NSDictionary *_validCharactersDict; expression[SA_DB_OPERAND_LEFT] = [self legacyExpressionForLegalString:[dieRollString substringToIndex:operatorRange.location]]; expression[SA_DB_OPERAND_RIGHT] = [self legacyExpressionForLegalString:[dieRollString substringFromIndex:(operatorRange.location + operatorRange.length)]]; - // Check to see if the term is a subtraction operation. - if([[SA_DiceParser validCharactersForOperator:SA_DB_OPERATOR_MINUS] containsCharactersInString:operator]) - { - expression[SA_DB_OPERATOR] = SA_DB_OPERATOR_MINUS; - } // Check to see if the term is an addition operation. - else if([[SA_DiceParser validCharactersForOperator:SA_DB_OPERATOR_PLUS] containsCharactersInString:operator]) + if([[SA_DiceParser validCharactersForOperator:SA_DB_OPERATOR_PLUS] containsCharactersInString:operator]) { expression[SA_DB_OPERATOR] = SA_DB_OPERATOR_PLUS; } + // Check to see if the term is a subtraction operation. + else if([[SA_DiceParser validCharactersForOperator:SA_DB_OPERATOR_MINUS] containsCharactersInString:operator]) + { + expression[SA_DB_OPERATOR] = SA_DB_OPERATOR_MINUS; + } // Check to see if the term is a multiplication operation. else if([[SA_DiceParser validCharactersForOperator:SA_DB_OPERATOR_TIMES] containsCharactersInString:operator]) {