1
0
mirror of https://github.com/danog/PHP-Parser.git synced 2024-11-30 04:19:30 +01:00

Improve PrettyPrinter construction perf by not using uniqid

The uniqid function is *very* slow on unix systems. The code has no
particular unique-ness requirements, so the much faster mt_rand()
function is used instead.

Closes PR #65.
This commit is contained in:
nikic 2013-07-13 01:03:57 +02:00
parent 5ccf6196d6
commit f9c3aa2a22

View File

@ -66,7 +66,7 @@ abstract class PHPParser_PrettyPrinterAbstract
protected $canUseSemicolonNamespaces;
public function __construct() {
$this->noIndentToken = uniqid('_NO_INDENT_');
$this->noIndentToken = '_NO_INDENT_' . mt_rand();
}
/**