|
@@ -75,14 +75,14 @@ StreamType DefaultInitializedContext::getStreamType() const {
|
|
|
|
|
|
void IOStream::initContexts() {
|
|
|
|
|
|
- auto* inStreamContext = getInputStreamContext();
|
|
|
- if (inStreamContext && !inStreamContext->isInitialized()) {
|
|
|
- inStreamContext->init();
|
|
|
+ auto& inStreamContext = getInputStreamContext();
|
|
|
+ if (!inStreamContext.isInitialized()) {
|
|
|
+ inStreamContext.init();
|
|
|
}
|
|
|
|
|
|
- auto* outStreamContext = getOutputStreamContext();
|
|
|
- if(outStreamContext && outStreamContext != inStreamContext && !outStreamContext->isInitialized()) {
|
|
|
- outStreamContext->init();
|
|
|
+ auto& outStreamContext = getOutputStreamContext();
|
|
|
+ if(outStreamContext != inStreamContext && !outStreamContext.isInitialized()) {
|
|
|
+ outStreamContext.init();
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -94,14 +94,14 @@ async::CoroutineStarter IOStream::initContextsAsync() {
|
|
|
|
|
|
async::CoroutineStarter starter(nullptr);
|
|
|
|
|
|
- auto* inStreamContext = getInputStreamContext();
|
|
|
- if (inStreamContext && !inStreamContext->isInitialized()) {
|
|
|
- starter.next(inStreamContext->initAsync());
|
|
|
+ auto& inStreamContext = getInputStreamContext();
|
|
|
+ if (!inStreamContext.isInitialized()) {
|
|
|
+ starter.next(inStreamContext.initAsync());
|
|
|
}
|
|
|
|
|
|
- auto* outStreamContext = getOutputStreamContext();
|
|
|
- if(outStreamContext && outStreamContext != inStreamContext && !outStreamContext->isInitialized()) {
|
|
|
- starter.next(outStreamContext->initAsync());
|
|
|
+ auto& outStreamContext = getOutputStreamContext();
|
|
|
+ if(outStreamContext != inStreamContext && !outStreamContext.isInitialized()) {
|
|
|
+ starter.next(outStreamContext.initAsync());
|
|
|
}
|
|
|
|
|
|
return starter;
|