mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-19 05:40:38 +01:00
[apps/shared/global_context] Inline SetExpressionForFunctionRecord
This commit is contained in:
committed by
Léa Saviot
parent
f4f45caf19
commit
84130236a8
@@ -118,13 +118,13 @@ Ion::Storage::Record::ErrorStatus GlobalContext::SetExpressionForActualSymbol(co
|
||||
return Ion::Storage::sharedStorage()->createRecordWithExtension(symbol.name(), Ion::Storage::expExtension, expression.addressInPool(), expression.size());
|
||||
}
|
||||
|
||||
Ion::Storage::Record::ErrorStatus GlobalContext::SetExpressionForFunctionRecord(Expression expressionToStore, Ion::Storage::Record previousRecord, const char * baseName) {
|
||||
Ion::Storage::Record::ErrorStatus GlobalContext::SetExpressionForFunction(const Expression & expressionToStore, const SymbolAbstract & symbol, Ion::Storage::Record previousRecord) {
|
||||
Ion::Storage::Record recordToSet = previousRecord;
|
||||
Ion::Storage::Record::ErrorStatus error = Ion::Storage::Record::ErrorStatus::None;
|
||||
if (!Ion::Storage::FullNameHasExtension(previousRecord.fullName(), Ion::Storage::funcExtension, strlen(Ion::Storage::funcExtension))) {
|
||||
// The previous record was not a function. Destroy it and create the new record.
|
||||
previousRecord.destroy();
|
||||
CartesianFunction newModel = CartesianFunction::NewModel(&error, baseName);
|
||||
CartesianFunction newModel = CartesianFunction::NewModel(&error, symbol.name());
|
||||
if (error != Ion::Storage::Record::ErrorStatus::None) {
|
||||
return error;
|
||||
}
|
||||
@@ -134,10 +134,6 @@ Ion::Storage::Record::ErrorStatus GlobalContext::SetExpressionForFunctionRecord(
|
||||
return error;
|
||||
}
|
||||
|
||||
Ion::Storage::Record::ErrorStatus GlobalContext::SetExpressionForFunction(const Expression & expressionToStore, const SymbolAbstract & symbol, Ion::Storage::Record previousRecord) {
|
||||
return SetExpressionForFunctionRecord(expressionToStore, previousRecord, symbol.name());
|
||||
}
|
||||
|
||||
Ion::Storage::Record GlobalContext::SymbolAbstractRecordWithBaseName(const char * name) {
|
||||
return Ion::Storage::sharedStorage()->recordBaseNamedWithExtensions(name, k_extensions, k_numberOfExtensions);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user