From 811b85e1b1ed7c107e2d6b290d23e5df04b1a929 Mon Sep 17 00:00:00 2001 From: laurens Date: Wed, 13 Nov 2019 00:03:30 +0100 Subject: [PATCH] Use .times iso until --- lib/cmock_header_parser.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/cmock_header_parser.rb b/lib/cmock_header_parser.rb index 6a33eb2..fdf005f 100644 --- a/lib/cmock_header_parser.rb +++ b/lib/cmock_header_parser.rb @@ -139,9 +139,9 @@ class CMockHeaderParser break if 0 == total_pairs_to_remove # Bad source? inline_function_stripped = inline_function_match.post_match - until total_pairs_to_remove == 0 + + total_pairs_to_remove.times do inline_function_stripped.sub!(/\s*#{square_bracket_pair_regex_format}/, ";") # Remove inline implementation (+ some whitespace because it's prettier) - total_pairs_to_remove -= 1 end source = inline_function_match.pre_match + inline_function_stripped # Make new source with the inline function removed and move on to the next