Committed by
Ray Milkey
Inline a variable and write comment
Change-Id: Id93338a39d5de2615801986704502ee02fe62d98
Showing
1 changed file
with
6 additions
and
24 deletions
... | @@ -42,7 +42,6 @@ public class MPLSProtocolMaskTlv implements PcepValueType { | ... | @@ -42,7 +42,6 @@ public class MPLSProtocolMaskTlv implements PcepValueType { |
42 | 42 | ||
43 | public static final short TYPE = 1094; //TDB39 | 43 | public static final short TYPE = 1094; //TDB39 |
44 | public static final short LENGTH = 1; | 44 | public static final short LENGTH = 1; |
45 | - public static final int SET = 1; | ||
46 | public static final byte LFLAG_SET = (byte) 0x80; | 45 | public static final byte LFLAG_SET = (byte) 0x80; |
47 | public static final byte RFLAG_SET = 0x40; | 46 | public static final byte RFLAG_SET = 0x40; |
48 | 47 | ||
... | @@ -58,19 +57,9 @@ public class MPLSProtocolMaskTlv implements PcepValueType { | ... | @@ -58,19 +57,9 @@ public class MPLSProtocolMaskTlv implements PcepValueType { |
58 | */ | 57 | */ |
59 | public MPLSProtocolMaskTlv(byte rawValue) { | 58 | public MPLSProtocolMaskTlv(byte rawValue) { |
60 | this.rawValue = rawValue; | 59 | this.rawValue = rawValue; |
61 | - isRawValueSet = true; | 60 | + this.isRawValueSet = true; |
62 | - byte temp = rawValue; | 61 | + this.bLFlag = (rawValue & LFLAG_SET) == LFLAG_SET; |
63 | - if ((temp & LFLAG_SET) == SET) { | 62 | + this.bRFlag = (rawValue & RFLAG_SET) == RFLAG_SET; |
64 | - this.bLFlag = true; | ||
65 | - | ||
66 | - } else { | ||
67 | - this.bLFlag = false; | ||
68 | - } | ||
69 | - if ((temp & RFLAG_SET) == SET) { | ||
70 | - this.bRFlag = true; | ||
71 | - } else { | ||
72 | - this.bRFlag = false; | ||
73 | - } | ||
74 | } | 63 | } |
75 | 64 | ||
76 | /** | 65 | /** |
... | @@ -194,16 +183,9 @@ public class MPLSProtocolMaskTlv implements PcepValueType { | ... | @@ -194,16 +183,9 @@ public class MPLSProtocolMaskTlv implements PcepValueType { |
194 | boolean bLFlag; | 183 | boolean bLFlag; |
195 | boolean bRFlag; | 184 | boolean bRFlag; |
196 | 185 | ||
197 | - if ((temp & LFLAG_SET) == SET) { | 186 | + bLFlag = (temp & LFLAG_SET) == LFLAG_SET; |
198 | - bLFlag = true; | 187 | + bRFlag = (temp & RFLAG_SET) == RFLAG_SET; |
199 | - } else { | 188 | + |
200 | - bLFlag = false; | ||
201 | - } | ||
202 | - if ((temp & RFLAG_SET) == SET) { | ||
203 | - bRFlag = true; | ||
204 | - } else { | ||
205 | - bRFlag = false; | ||
206 | - } | ||
207 | return new MPLSProtocolMaskTlv(bLFlag, bRFlag); | 189 | return new MPLSProtocolMaskTlv(bLFlag, bRFlag); |
208 | } | 190 | } |
209 | 191 | ... | ... |
-
Please register or login to post a comment