Commit graph

4 commits

Author SHA1 Message Date
Timo Tijhof
5a7670e426 Minor OrderedStreamingForkController improvements
Follows-up c94dea7029.

* Avoid strlen() where a strict check suffices.
* Use substr() for both comparison and stripping, avoid
  potentially expensive, but also fragile, because strlen()-1
  can  produce $str[-1], which would
  > PHP Notice:  Uninitialized string offset: -1
  Luckily, the implied null would work as expected, given that
  `null !== "\n"` and produces the same result.

Change-Id: If61e5e412aaa2dc7c00c4441b3b7bd5f04160ec8
2018-10-10 22:37:02 +01:00
Erik Bernhardson
c94dea7029 Only strip newline in OrderedStreamingForkController
The controller should pass through lines of input exactly as
they were provided, only stripping the trailing newline that
delimits items. The trim was making `door` and `door ` equivilant
but for the use case in search the distinction is important.

Additionally check that the line is actually empty, don't throw
away inputs like '0' which are falsy.

Change-Id: Ifac910543fdb46a27da021e831e3e18befefcfc5
2018-09-28 12:00:32 -07:00
Umherirrender
f739a8f368 Improve some parameter docs
Add missing @return and @param to function docs and fixed some @param

Change-Id: I810727961057cfdcc274428b239af5975c57468d
2017-09-10 20:32:31 +02:00
Stanislav Malyshev
c82d30d19c Move OrderedStreamingForkController class from CirrusSearch to core.
This class may be useful for scripts outside CirrusSearch.

Change-Id: I1ed993a3b0b64d828ae5caba6c4b540b77b2f6f5
2017-09-07 10:27:43 -07:00