Skip to content

Commit

Permalink
BREAKING CHANGE: TRawUtf8List is not thread-safe by default
Browse files Browse the repository at this point in the history
- unless fThreadSafe is set to use the TRWLock
- as in mORMot 1
- so sligthly faster, and comparable to TStringList by default
- also rewritten not PUREMORMOT2 classes TRawUtf8ListLocked/TRawUtf8ListHashed/TRawUtf8ListHashedLock to behave exactly as in mORMot 1
- our previous implementation was clearly confusing, especially when coming from mORMot 1, and even non-compatible when porting existing mORMot 1 applications
  • Loading branch information
Arnaud Bouchez committed Mar 20, 2023
1 parent b094f31 commit cfffde9
Show file tree
Hide file tree
Showing 9 changed files with 88 additions and 58 deletions.
4 changes: 2 additions & 2 deletions ex/mvc-blog/MVCModel.pas
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ class function TDotClearTable.Parse(const aFlatExport: RawUtf8): TRawUtf8List;
P: PUtf8Char;
T: TDotClearTable;
begin
result := TRawUtf8List.Create(true);
result := TRawUtf8List.CreateEx([fObjectsOwned, fCaseSensitive]);
P := pointer(aFlatExport);
repeat
while (P <> nil) and
Expand Down Expand Up @@ -725,7 +725,7 @@ procedure DotClearFlatImport(const Rest: IRestOrm; const aFlatFile: RawUtf8;
end;
auto1 := TAutoFree.Several([
@data, TDotClearTable.Parse(aFlatFile),
@urls, TRawUtf8ListHashed.Create,
@urls, TRawUtf8List.Create([fNoDuplicate]),
@batch, TRestBatch.Create(Rest, TOrmTag, 5000)]);
auto2 := TOrm.AutoFree([ // avoid several try..finally
@info, TOrmBlogInfo,
Expand Down
Loading

0 comments on commit cfffde9

Please sign in to comment.