Skip to content

Commit

Permalink
Revert "Converter: Fix warning shown when converting (#14)"
Browse files Browse the repository at this point in the history
This reverts commit 240ef60.
  • Loading branch information
ryonakano committed Apr 23, 2024
1 parent 240ef60 commit 0dd595e
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lib/Converter.vala
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,7 @@ namespace ChCase {
* @param text Text to be converted
* @return Result text after conversion
*/
public string convert_case (string text) {
string result = text;
public string convert_case (owned string text) {
PatternType.Pattern regex_pattern;
switch (source_case) {
case Case.SPACE_SEPARATED:
Expand Down Expand Up @@ -274,14 +273,14 @@ namespace ChCase {
for (int i = 0; i < regex_pattern.detect_patterns.length; i++) {
var regex = new Regex (regex_pattern.detect_patterns.index (i));
for (regex.match (text, 0, out match_info); match_info.matches (); match_info.next ()) {
result = regex.replace (text, text.length, 0, regex_pattern.replace_patterns.index (i));
text = regex.replace (text, text.length, 0, regex_pattern.replace_patterns.index (i));
}
}
} catch (RegexError e) {
warning (e.message);
}

return result;
return text;
}
}
}

0 comments on commit 0dd595e

Please sign in to comment.