Differential D25094 Diff 396 src/applications/differential/xaction/DifferentialRevisionTitleTransaction.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/differential/xaction/DifferentialRevisionTitleTransaction.php
Show All 17 Lines | public function getTitle() { | ||||
return pht( | return pht( | ||||
'%s retitled this revision from %s to %s.', | '%s retitled this revision from %s to %s.', | ||||
$this->renderAuthor(), | $this->renderAuthor(), | ||||
$this->renderOldValue(), | $this->renderOldValue(), | ||||
$this->renderNewValue()); | $this->renderNewValue()); | ||||
} | } | ||||
public function getTitleForFeed() { | public function getTitleForFeed() { | ||||
$obj = $this->getObject(); | |||||
// To avoid verbose messages we mention the current title just once | |||||
if ($obj && $obj->getTitle() === $this->getNewValue()) { | |||||
avivey: don't we use strcmp to compare strings?
| |||||
Done Inline ActionsInteresting. Why? valerio.bozzolan: Interesting. Why? | |||||
Done Inline ActionsI mra valerio.bozzolan: I mra | |||||
Done Inline ActionsI'm quite sure in this specific case the === operator is the right one to verify if two strings have the very same binary value. AFAIK the strcmp was introduced to handle other cases where you need to understand the comparison difference (greater, equals, less than). valerio.bozzolan: I'm quite sure in this specific case the `===` operator is the right one to verify if two… | |||||
Done Inline ActionsTBH, I don't remember the reasoning. Possibly, because there are different ways to write "the same" string, and the string functions handle those? I agree about the same-binary-value argument in this particular case, tough. avivey: TBH, I don't remember the reasoning. Possibly, because there are different ways to write "the… | |||||
return pht( | |||||
'%s retitled %s from %s', | |||||
$this->renderAuthor(), | |||||
$this->renderObject(), | |||||
$this->renderOldValue()); | |||||
} | |||||
return pht( | return pht( | ||||
'%s retitled %s from %s to %s.', | '%s retitled %s from %s to %s.', | ||||
$this->renderAuthor(), | $this->renderAuthor(), | ||||
$this->renderObject(), | $this->renderObject(), | ||||
$this->renderOldValue(), | $this->renderOldValue(), | ||||
$this->renderNewValue()); | $this->renderNewValue()); | ||||
} | } | ||||
Show All 36 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
don't we use strcmp to compare strings?