Make a lot of one-liner functions inline
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
@@ -28,31 +28,31 @@ namespace Porygon::Diagnostics {
|
||||
delete _message;
|
||||
}
|
||||
|
||||
DiagnosticSeverity GetSeverity() {
|
||||
inline DiagnosticSeverity GetSeverity() {
|
||||
return _severity;
|
||||
}
|
||||
|
||||
DiagnosticCode GetCode() {
|
||||
inline DiagnosticCode GetCode() {
|
||||
return _code;
|
||||
}
|
||||
|
||||
unsigned int GetStartPosition() {
|
||||
inline unsigned int GetStartPosition() {
|
||||
return _start;
|
||||
}
|
||||
|
||||
unsigned int GetLength() {
|
||||
inline unsigned int GetLength() {
|
||||
return _length;
|
||||
}
|
||||
|
||||
std::vector<std::string> GetArguments(){
|
||||
inline std::vector<std::string> GetArguments(){
|
||||
return _arguments;
|
||||
}
|
||||
|
||||
void SetMessage(std::string* s){
|
||||
inline void SetMessage(std::string* s){
|
||||
this -> _message = s;
|
||||
}
|
||||
|
||||
std::string* GetMessage(){
|
||||
inline std::string* GetMessage(){
|
||||
return _message;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -17,27 +17,27 @@ void DiagnosticsHolder::Log(DiagnosticSeverity severity, DiagnosticCode code, un
|
||||
}
|
||||
}
|
||||
|
||||
void DiagnosticsHolder::LogError(DiagnosticCode code, unsigned int start, unsigned int length, std::vector<string> arguments) {
|
||||
inline void DiagnosticsHolder::LogError(DiagnosticCode code, unsigned int start, unsigned int length, std::vector<string> arguments) {
|
||||
Log(DiagnosticSeverity::Error, code, start, length, std::move(arguments));
|
||||
}
|
||||
|
||||
void DiagnosticsHolder::LogWarning(DiagnosticCode code, unsigned int start, unsigned int length, std::vector<string> arguments) {
|
||||
inline void DiagnosticsHolder::LogWarning(DiagnosticCode code, unsigned int start, unsigned int length, std::vector<string> arguments) {
|
||||
Log(DiagnosticSeverity::Warning, code, start, length, std::move(arguments));
|
||||
}
|
||||
|
||||
void DiagnosticsHolder::LogInfo(DiagnosticCode code, unsigned int start, unsigned int length, std::vector<string> arguments) {
|
||||
inline void DiagnosticsHolder::LogInfo(DiagnosticCode code, unsigned int start, unsigned int length, std::vector<string> arguments) {
|
||||
Log(DiagnosticSeverity::Info, code, start, length, std::move(arguments));
|
||||
}
|
||||
|
||||
bool DiagnosticsHolder::HasErrors() {
|
||||
inline bool DiagnosticsHolder::HasErrors() {
|
||||
return _hasErrors;
|
||||
}
|
||||
|
||||
int DiagnosticsHolder::DiagnosticsCount() {
|
||||
inline int DiagnosticsHolder::DiagnosticsCount() {
|
||||
return _diagnostics.size();
|
||||
}
|
||||
|
||||
Diagnostic *DiagnosticsHolder::GetDiagnosticAt(int position) {
|
||||
inline Diagnostic *DiagnosticsHolder::GetDiagnosticAt(int position) {
|
||||
return &_diagnostics[position];
|
||||
}
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ namespace Porygon::Diagnostics {
|
||||
Diagnostic *GetDiagnosticAt(int position);
|
||||
|
||||
size_t GetLineFromPosition(size_t i);
|
||||
size_t GetStartPositionForLine(size_t i){
|
||||
inline size_t GetStartPositionForLine(size_t i){
|
||||
return _lineStarts[i];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user