Make the output type of a property source read-only.
This commit is contained in:
@@ -252,7 +252,8 @@ namespace Cryville.Crtr {
|
||||
readonly Func<string> _cb;
|
||||
readonly ArrayPool<byte> _pool;
|
||||
byte[] _buf;
|
||||
public ScoreStringSrc(ArrayPool<byte> pool, Func<string> cb) {
|
||||
public ScoreStringSrc(ArrayPool<byte> pool, Func<string> cb)
|
||||
: base(PdtInternalType.String) {
|
||||
_pool = pool;
|
||||
_cb = cb;
|
||||
}
|
||||
@@ -263,7 +264,7 @@ namespace Cryville.Crtr {
|
||||
_buf = null;
|
||||
}
|
||||
}
|
||||
protected override unsafe int InternalGet() {
|
||||
protected override unsafe void InternalGet() {
|
||||
var src = _cb();
|
||||
int strlen = src.Length;
|
||||
buf = _pool.Rent(sizeof(int) + strlen * sizeof(char));
|
||||
@@ -273,7 +274,6 @@ namespace Cryville.Crtr {
|
||||
int i = 0;
|
||||
foreach (var c in src) ptr[i++] = c;
|
||||
}
|
||||
return PdtInternalType.String;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
Reference in New Issue
Block a user