Skip to content

Commit

Permalink
Pattern: Init in the default constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
ryonakano committed Apr 13, 2021
1 parent eca7060 commit 4bb3e79
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions lib/Case.vala
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
*/

namespace ChCase {

/**
* Represents the case of a text.
*/
Expand Down
10 changes: 5 additions & 5 deletions lib/PatternType/Pattern.vala
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,6 @@ namespace ChCase.PatternType {
public GLib.Array<string> replace_patterns { get; construct; }

protected Pattern (Case result_case) {
Object (
detect_patterns: new GLib.Array<string> (),
replace_patterns: new GLib.Array<string> ()
);

switch (result_case) {
case Case.SPACE_SEPARATED:
to_space_separated ();
Expand All @@ -71,6 +66,11 @@ namespace ChCase.PatternType {
}
}

construct {
detect_patterns = new GLib.Array<string> ();
replace_patterns = new GLib.Array<string> ();
}

/**
* Set regex patterns; one is to detect the source case and another is to detect the result case.
*
Expand Down

0 comments on commit 4bb3e79

Please sign in to comment.