Introduce IdentifierManager to improve PDT evaluator performance.
This commit is contained in:
@@ -101,11 +101,10 @@ namespace Cryville.Common.Pdt {
|
||||
/// <param name="offset">The offset on the span to start reading from.</param>
|
||||
/// <returns>The name of an undefined identifier.</returns>
|
||||
/// <exception cref="InvalidCastException">The span does not represent an undefined identifier.</exception>
|
||||
public string AsIdentifier(int offset = 0) {
|
||||
public int AsIdentifier(int offset = 0) {
|
||||
if (Type != PdtInternalType.Undefined && Type != PdtInternalType.Array)
|
||||
throw new InvalidCastException("Not an identifier");
|
||||
var len = *(int*)(_ptr + offset);
|
||||
return new string((char*)(_ptr + offset + sizeof(int)), 0, len);
|
||||
return *(int*)(_ptr + offset);
|
||||
}
|
||||
internal void* TrustedAsOfLength(int len) {
|
||||
if (Length < len)
|
||||
|
Reference in New Issue
Block a user