mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-09-11 11:25:40 +03:00
Reformatting for readability. In ReadInput: delete source only if non-NULL.
This commit is contained in:
parent
a7c85780ee
commit
b3043d9b00
@ -182,7 +182,9 @@ void IOWrapper::Initialization(const std::vector<FactorType> &/*inputFactorOrder
|
||||
|
||||
}
|
||||
|
||||
InputType*IOWrapper::GetInput(InputType* inputType)
|
||||
InputType*
|
||||
IOWrapper::
|
||||
GetInput(InputType* inputType)
|
||||
{
|
||||
if(inputType->Read(*m_inputStream, m_inputFactorOrder)) {
|
||||
if (long x = inputType->GetTranslationId()) {
|
||||
@ -605,7 +607,7 @@ void IOWrapper::OutputLatticeMBRNBestList(const vector<LatticeMBRSolution>& solu
|
||||
|
||||
bool ReadInput(IOWrapper &ioWrapper, InputTypeEnum inputType, InputType*& source)
|
||||
{
|
||||
delete source;
|
||||
if (source) delete source;
|
||||
switch(inputType) {
|
||||
case SentenceInput:
|
||||
source = ioWrapper.GetInput(new Sentence);
|
||||
@ -618,6 +620,7 @@ bool ReadInput(IOWrapper &ioWrapper, InputTypeEnum inputType, InputType*& source
|
||||
break;
|
||||
default:
|
||||
TRACE_ERR("Unknown input type: " << inputType << "\n");
|
||||
source = NULL;
|
||||
}
|
||||
return (source ? true : false);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user