only call the getClockSeqHiAndReserved method once because it will have the same data each time

This commit is contained in:
Eric Thelin
2013-04-15 17:48:14 -05:00
parent 40a13a18c6
commit 77d2aa5007
+4 -3
View File
@@ -719,11 +719,12 @@ final class Uuid
*/
public function getVariant()
{
if (0 === ($this->getClockSeqHiAndReserved() & 0x80)) {
$clockSeq = $this->getClockSeqHiAndReserved();
if (0 === ($clockSeq & 0x80)) {
$variant = self::RESERVED_NCS;
} elseif (0 === ($this->getClockSeqHiAndReserved() & 0x40)) {
} elseif (0 === ($clockSeq & 0x40)) {
$variant = self::RFC_4122;
} elseif (0 === ($this->getClockSeqHiAndReserved() & 0x20)) {
} elseif (0 === ($clockSeq & 0x20)) {
$variant = self::RESERVED_MICROSOFT;
} else {
$variant = self::RESERVED_FUTURE;