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:
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…
Reference in New Issue
Block a user