diff options
author | Simon MacMullen <simon@rabbitmq.com> | 2012-05-28 12:31:52 +0100 |
---|---|---|
committer | Simon MacMullen <simon@rabbitmq.com> | 2012-05-28 12:31:52 +0100 |
commit | ea453f74e78ee57fd15df2edc566640a784336cb (patch) | |
tree | eb671af3622af79fe3ac699f77c8e4ce2b2e2786 | |
parent | a843e83d4f626a39894f5ba9768a0761df1a0f90 (diff) | |
download | rabbitmq-server-bug24958.tar.gz |
Cosmetic-ish: no need to pre-compile the RE, and use character class rather than range.bug24958
-rw-r--r-- | src/rabbit_disk_monitor.erl | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/rabbit_disk_monitor.erl b/src/rabbit_disk_monitor.erl index f3a553b4..d9e8e8e4 100644 --- a/src/rabbit_disk_monitor.erl +++ b/src/rabbit_disk_monitor.erl @@ -178,9 +178,8 @@ parse_free_unix(CommandResult) -> parse_free_win32(CommandResult) -> LastLine = lists:last(string:tokens(CommandResult, "\r\n")), - {ok, Digits} = re:compile("([0-9]+)"), - {match,[Free]} = - re:run(lists:reverse(LastLine), Digits, [{capture, all_but_first, list}]), + {match, [Free]} = re:run(lists:reverse(LastLine), "(\\d+)", + [{capture, all_but_first, list}]), list_to_integer(lists:reverse(Free)). interpret_limit({mem_relative, R}) -> |