From: Michael Stapelberg Date: Mon, 22 Mar 2010 20:42:35 +0000 (+0100) Subject: use constant instead of magic number X-Git-Tag: AnyEvent-0.02~9 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=bc05cb9051e80ebf8a5efef23ad8e63c07ce1bd2;p=i3%2Fi3 use constant instead of magic number --- diff --git a/lib/AnyEvent/I3.pm b/lib/AnyEvent/I3.pm index 2addeb34..e69604a8 100644 --- a/lib/AnyEvent/I3.pm +++ b/lib/AnyEvent/I3.pm @@ -167,7 +167,8 @@ sub subscribe { my ($self, $callbacks) = @_; my $payload = encode_json [ keys %{$callbacks} ]; - my $message = $magic . pack("LL", length($payload), 2) . $payload; + my $len = length($payload); + my $message = $magic . pack("LL", $len, TYPE_SUBSCRIBE) . $payload; $self->{ipchdl}->push_write($message); # Register callbacks for each message type