File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -295,12 +295,6 @@ Expected<LazyMappedFileRegion> LazyMappedFileRegion::create(
295
295
// do the initialization) or we have the size for the completely initialized
296
296
// file.
297
297
298
- if (Status.getSize () > 0 )
299
- // The file was already constructed.
300
- LMFR.CachedSize = Status.getSize ();
301
- else
302
- LMFR.IsConstructingNewFile = true ;
303
-
304
298
{
305
299
std::error_code EC;
306
300
sys::fs::mapped_file_region Map (
@@ -310,10 +304,14 @@ Expected<LazyMappedFileRegion> LazyMappedFileRegion::create(
310
304
LMFR.Map = std::move (Map);
311
305
}
312
306
313
- if (!LMFR.IsConstructingNewFile )
307
+ if (Status.getSize () > 0 ) {
308
+ // The file was already constructed.
309
+ LMFR.CachedSize = Status.getSize ();
314
310
return std::move (LMFR);
311
+ }
315
312
316
313
// This is a new file. Resize to NewFileSize and run the constructor.
314
+ LMFR.IsConstructingNewFile = true ;
317
315
if (Error E = NewFileConstructor (LMFR))
318
316
return std::move (E);
319
317
assert (LMFR.size () > 0 && " Constructor must set a non-zero size" );
You can’t perform that action at this time.
0 commit comments