TitleValue: Don't use Assert for basic type checks
authorKunal Mehta <legoktm@member.fsf.org>
Wed, 15 Aug 2018 04:09:44 +0000 (21:09 -0700)
committerKunal Mehta <legoktm@member.fsf.org>
Wed, 15 Aug 2018 04:09:44 +0000 (21:09 -0700)
commit9b4567f4145985dc9dd0653031e02118ce90bb18
tree6aed0faaa251fb06244f755af179ee404c52bb68
parentf339c908513e4c8e7923cc0366a6ceebcbcc3a16
TitleValue: Don't use Assert for basic type checks

Previously, `new TitleValue()` was roughly twice as slow as
`Title::makeTitle()`. Switching to basic is_int/is_string checks
makes TitleValue roughly twice as fast as Title!

Tested with benchmarkTitleValue.php.

Bug: T201801
Change-Id: Idccf159983145c1c11af9182292e1d5f704ba077
includes/title/TitleValue.php