Skip to content

Commit

Permalink
util: add const to a static variable in function
Browse files Browse the repository at this point in the history
  • Loading branch information
aesophor committed Aug 13, 2019
1 parent 57881b9 commit 3471e9c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ string KeymaskToStr(int modifier) {
}

int StrToKeymask(const string& modifier, bool shift) {
static int mod_masks[6] = { 0, Mod1Mask, Mod2Mask, Mod3Mask, Mod4Mask, Mod5Mask };
static const int mod_masks[6] = {0, Mod1Mask, Mod2Mask, Mod3Mask, Mod4Mask, Mod5Mask};
int modifier_id = modifier.at(3) - '0'; // "Mod4": 0123

if (modifier_id >= 1 && modifier_id <= 5) {
Expand Down

0 comments on commit 3471e9c

Please sign in to comment.