mirror of
https://github.com/nikic/PHP-Parser.git
synced 2025-01-17 15:18:17 +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:
parent
5ccf6196d6
commit
f9c3aa2a22
@ -66,7 +66,7 @@ abstract class PHPParser_PrettyPrinterAbstract
|
||||
protected $canUseSemicolonNamespaces;
|
||||
|
||||
public function __construct() {
|
||||
$this->noIndentToken = uniqid('_NO_INDENT_');
|
||||
$this->noIndentToken = '_NO_INDENT_' . mt_rand();
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user