From 54a47ad3a59085c37c4f47ec26715eeed2924c14 Mon Sep 17 00:00:00 2001 From: EnderIce2 Date: Wed, 11 Oct 2023 13:00:15 +0300 Subject: [PATCH] Update std headers --- include_std/list | 12 ++++++------ include_std/std.hpp | 9 --------- tests/std.cpp | 2 +- 3 files changed, 7 insertions(+), 16 deletions(-) diff --git a/include_std/list b/include_std/list index a15d258..480e570 100644 --- a/include_std/list +++ b/include_std/list @@ -18,7 +18,6 @@ #pragma once #include -#include namespace std { @@ -62,9 +61,9 @@ namespace std void pop_back() { - if (empty()) + if (unlikely(empty())) { - throw std::runtime_error("list is empty"); + assert(!"list is empty"); } else if (head == tail) { @@ -99,11 +98,12 @@ namespace std void pop_front() { - if (empty()) + if (unlikely(empty())) { - throw std::runtime_error("list is empty"); + assert(!"list is empty"); } - else if (head == tail) + + if (head == tail) { delete head; head = tail = nullptr; diff --git a/include_std/std.hpp b/include_std/std.hpp index 181436e..59f8f6c 100644 --- a/include_std/std.hpp +++ b/include_std/std.hpp @@ -22,15 +22,6 @@ #define __FENNIX_KERNEL_STD_H__ #include -#include -#include -#include -#include -#include -#include -#include -#include -#include /** * @brief // stub namespace for std::align_val_t and new operator diff --git a/tests/std.cpp b/tests/std.cpp index f09d6b3..90d09f0 100644 --- a/tests/std.cpp +++ b/tests/std.cpp @@ -17,9 +17,9 @@ #ifdef DEBUG -#include #include #include +#include void Test_std() {