Changeset View
Changeset View
Standalone View
Standalone View
src/utils/PhutilSortVector.php
Show All 24 Lines | if ($value === ~PHP_INT_MAX) { | ||||
$prefix = 'C'; | $prefix = 'C'; | ||||
} | } | ||||
$this->parts[] = sprintf('%s%020u', $prefix, $value); | $this->parts[] = sprintf('%s%020u', $prefix, $value); | ||||
return $this; | return $this; | ||||
} | } | ||||
public function addString($value) { | public function addString($value) { | ||||
if (strlen($value) && (strpos("\0", $value) !== false)) { | if (strlen($value) && (strpos($value, "\0") !== false)) { | ||||
throw new Exception( | throw new Exception( | ||||
pht( | pht( | ||||
'String components of a sort vector must not contain NULL bytes.')); | 'String components of a sort vector must not contain NULL bytes.')); | ||||
} | } | ||||
$this->parts[] = $value; | $this->parts[] = $value; | ||||
return $this; | return $this; | ||||
} | } | ||||
Show All 13 Lines |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0