summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSimon MacMullen <simon@rabbitmq.com>2012-05-28 12:31:52 +0100
committerSimon MacMullen <simon@rabbitmq.com>2012-05-28 12:31:52 +0100
commit5dd0b08e0c5f26248abedb4b36bef6d7ff9f3e01 (patch)
treeeb671af3622af79fe3ac699f77c8e4ce2b2e2786 /src
parent8822e5bd2e4121c78b677f7b5b62805be126facf (diff)
downloadrabbitmq-server-git-5dd0b08e0c5f26248abedb4b36bef6d7ff9f3e01.tar.gz
Cosmetic-ish: no need to pre-compile the RE, and use character class rather than range.
Diffstat (limited to 'src')
-rw-r--r--src/rabbit_disk_monitor.erl5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/rabbit_disk_monitor.erl b/src/rabbit_disk_monitor.erl
index f3a553b438..d9e8e8e469 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}) ->