1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 13:27:36 +00:00

Everywhere: Remove a bunch of redundant 'AK::' namespace prefixes

This is basically just for consistency, it's quite strange to see
multiple AK container types next to each other, some with and some
without the namespace prefix - we're 'using AK::Foo;' a lot and should
leverage that. :^)
This commit is contained in:
Linus Groh 2021-02-25 21:10:47 +01:00 committed by Andreas Kling
parent be9df404fd
commit e265054c12
73 changed files with 111 additions and 110 deletions

View file

@ -63,8 +63,8 @@ static void add_if_not_exists(Vector<Index>& indexes, Index data)
for (auto& index : indexes) {
if (index.intersects(data)) {
if (index.m_type == Index::Type::RangedIndex) {
index.m_from = AK::min(index.m_from, data.m_from);
index.m_to = AK::max(index.m_to, data.m_to);
index.m_from = min(index.m_from, data.m_from);
index.m_to = max(index.m_to, data.m_to);
}
append_to_vector = false;
}

View file

@ -406,14 +406,14 @@ static void print(JS::Value value)
outln();
}
static bool file_has_shebang(AK::ByteBuffer file_contents)
static bool file_has_shebang(ByteBuffer file_contents)
{
if (file_contents.size() >= 2 && file_contents[0] == '#' && file_contents[1] == '!')
return true;
return false;
}
static StringView strip_shebang(AK::ByteBuffer file_contents)
static StringView strip_shebang(ByteBuffer file_contents)
{
size_t i = 0;
for (i = 2; i < file_contents.size(); ++i) {

View file

@ -64,7 +64,7 @@ int main(int argc, char** argv)
const char* format = flag_show_numerical ? format_numerical : format_textual;
AK::RefPtr<PCIDB::Database> db;
RefPtr<PCIDB::Database> db;
if (!flag_show_numerical) {
db = PCIDB::Database::open();
if (!db) {

View file

@ -38,7 +38,7 @@ static void test_no_route(int);
static void test_valid(int);
static void test_send(int);
static void test(AK::Function<void(int)> test_fn)
static void test(Function<void(int)> test_fn)
{
int fd = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);

View file

@ -2217,7 +2217,7 @@ static void bigint_test_fibo500()
{
{
I_TEST((BigInteger | Fibonacci500));
bool pass = (bigint_fibonacci(500).words() == AK::Vector<u32> { 315178285, 505575602, 1883328078, 125027121, 3649625763, 347570207, 74535262, 3832543808, 2472133297, 1600064941, 65273441 });
bool pass = (bigint_fibonacci(500).words() == Vector<u32> { 315178285, 505575602, 1883328078, 125027121, 3649625763, 347570207, 74535262, 3832543808, 2472133297, 1600064941, 65273441 });
if (pass) {
PASS;
@ -2428,7 +2428,7 @@ static void bigint_import_export()
I_TEST((BigInteger | BigEndian Decode / Encode roundtrip));
u8 random_bytes[128];
u8 target_buffer[128];
AK::fill_with_random(random_bytes, 128);
fill_with_random(random_bytes, 128);
auto encoded = Crypto::UnsignedBigInteger::import_data(random_bytes, 128);
encoded.export_data({ target_buffer, 128 });
if (memcmp(target_buffer, random_bytes, 128) != 0)
@ -2540,7 +2540,7 @@ static void bigint_test_signed_fibo500()
{
{
I_TEST((Signed BigInteger | Fibonacci500));
bool pass = (bigint_signed_fibonacci(500).unsigned_value().words() == AK::Vector<u32> { 315178285, 505575602, 1883328078, 125027121, 3649625763, 347570207, 74535262, 3832543808, 2472133297, 1600064941, 65273441 });
bool pass = (bigint_signed_fibonacci(500).unsigned_value().words() == Vector<u32> { 315178285, 505575602, 1883328078, 125027121, 3649625763, 347570207, 74535262, 3832543808, 2472133297, 1600064941, 65273441 });
if (pass) {
PASS;
@ -2745,7 +2745,7 @@ static void bigint_signed_import_export()
u8 random_bytes[129];
u8 target_buffer[129];
random_bytes[0] = 1;
AK::fill_with_random(random_bytes + 1, 128);
fill_with_random(random_bytes + 1, 128);
auto encoded = Crypto::SignedBigInteger::import_data(random_bytes, 129);
encoded.export_data({ target_buffer, 129 });
if (memcmp(target_buffer, random_bytes, 129) != 0)

View file

@ -54,7 +54,7 @@ static void print_directory_tree(const String& root_path, int depth, const Strin
out("{}|-- ", root_indent_string);
}
String root_dir_name = AK::LexicalPath(root_path).basename();
String root_dir_name = LexicalPath(root_path).basename();
out("\033[34;1m{}\033[0m\n", root_dir_name);
if (depth >= max_depth) {

View file

@ -89,7 +89,7 @@ int main(int argc, char** argv)
continue;
fputs(current->buf, outfile);
AK::swap(current, previous);
swap(current, previous);
first_run = false;
}