We do not need to check JFI validity if JSON document is valid

This commit is contained in:
Alex Spataru 2021-09-24 17:58:53 -05:00
parent c5a651a8b7
commit 749cc48cd7
3 changed files with 1 additions and 13 deletions

View File

@ -297,6 +297,5 @@ void Export::registerFrame(const JFI_Object &info)
return;
// Update JSON list
if (JFI_Valid(info))
m_jsonList.append(info);
}

View File

@ -22,15 +22,6 @@
#include "FrameInfo.h"
/**
* Returns @c true if the given JFI @info structure has a non-empty JSON document and a
* valid frame number.
*/
bool JFI_Valid(const JFI_Object &info)
{
return info.frameNumber >= 0 && !info.jsonDocument.isEmpty();
}
/**
* Orders the given JFI @c list from least recent (first item) to most recent (last item)
* using a simple Bubble-Sort algorithm.

View File

@ -35,9 +35,7 @@ typedef struct
} JFI_Object;
Q_DECLARE_METATYPE(JFI_Object)
extern bool JFI_Valid(const JFI_Object &info);
extern void JFI_SortList(QList<JFI_Object> *list);
extern JFI_Object JFI_Empty(const quint64 n = 0);
extern JFI_Object JFI_CreateNew(const quint64 n, const QDateTime &t,
const QJsonDocument &d);