mirror of
https://bitbucket.org/seefoe/src.git
synced 2026-08-02 03:15:57 -04:00
remove unnecessary null checks
This commit is contained in:
@@ -614,7 +614,6 @@ int DataTable::searchColumnString( int column, const std::string & searchValue )
|
||||
if (!voidIndex)
|
||||
{
|
||||
std::pair<std::multimap<const std::string, int>, std::multimap<int, int> > * indexPair = new std::pair<std::multimap<const std::string, int>, std::multimap<int, int> >;
|
||||
NOT_NULL(indexPair);
|
||||
|
||||
m_index[static_cast<size_t>(column)] = static_cast<void *>(indexPair);
|
||||
|
||||
@@ -653,7 +652,6 @@ int DataTable::searchColumnFloat( int column, float searchValue ) const
|
||||
if (!voidIndex)
|
||||
{
|
||||
std::multimap<float, int> * index = new std::multimap<float, int>;
|
||||
NOT_NULL(index);
|
||||
|
||||
m_index[static_cast<size_t>(column)] = static_cast<void *>(index);
|
||||
|
||||
@@ -692,7 +690,6 @@ int DataTable::searchColumnInt( int column, int searchValue ) const
|
||||
if (columnType == DataTableColumnType::DT_Int)
|
||||
{
|
||||
std::multimap<int, int> * index = new std::multimap<int, int>;
|
||||
NOT_NULL(index);
|
||||
|
||||
m_index[static_cast<size_t>(column)] = static_cast<void *>(index);
|
||||
|
||||
@@ -709,7 +706,6 @@ int DataTable::searchColumnInt( int column, int searchValue ) const
|
||||
else if (columnType == DataTableColumnType::DT_String)
|
||||
{
|
||||
std::pair<std::multimap<const std::string, int>, std::multimap<int, int> > * indexPair = new std::pair<std::multimap<const std::string, int>, std::multimap<int, int> >;
|
||||
NOT_NULL(indexPair);
|
||||
|
||||
m_index[static_cast<size_t>(column)] = static_cast<void *>(indexPair);
|
||||
|
||||
|
||||
@@ -543,7 +543,6 @@ void DataTableWriter::_loadFromSpreadsheetTab(const char * filename)
|
||||
int bufferLength = fileLength + 1;
|
||||
char* buffer = new char[bufferLength];
|
||||
memset(buffer, 0, bufferLength);
|
||||
NOT_NULL(buffer);
|
||||
|
||||
int bytes_read = inputFile.read(buffer, fileLength);
|
||||
FATAL(!bytes_read, ("Didn't read in any bytes when loading %s.", filename));
|
||||
|
||||
@@ -998,7 +998,6 @@ void DynamicVariableParamData::loadFromIff(Iff &file)
|
||||
for (int i = 0; i < count; ++i)
|
||||
{
|
||||
DynamicVariableParamData *newData = new DynamicVariableParamData;
|
||||
NOT_NULL(newData);
|
||||
newData->loadFromIff(file);
|
||||
m_data.lparam->push_back(newData);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user