mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-03 08:08:43 +00:00
Applications: Change static constexpr variables to constexpr
Function-local `static constexpr` variables can be `constexpr`. This can reduce memory consumption, binary size, and offer additional compiler optimizations.
This commit is contained in:
parent
7012a5eb0b
commit
1dd70a6f49
Notes:
sideshowbarker
2024-07-17 18:09:10 +09:00
Author: https://github.com/ldm5180
Commit: 1dd70a6f49
Pull-request: https://github.com/SerenityOS/serenity/pull/12419
10 changed files with 67 additions and 60 deletions
|
@ -1,5 +1,6 @@
|
|||
/*
|
||||
* Copyright (c) 2021, Matthew Olsson <mattco@serenityos.org>
|
||||
* Copyright (c) 2022, the SerenityOS developers.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
@ -11,28 +12,6 @@
|
|||
#include <LibGfx/Bitmap.h>
|
||||
#include <LibPDF/Document.h>
|
||||
|
||||
static constexpr u16 zoom_levels[] = {
|
||||
17,
|
||||
21,
|
||||
26,
|
||||
33,
|
||||
41,
|
||||
51,
|
||||
64,
|
||||
80,
|
||||
100,
|
||||
120,
|
||||
144,
|
||||
173,
|
||||
207,
|
||||
249,
|
||||
299,
|
||||
358,
|
||||
430
|
||||
};
|
||||
|
||||
static constexpr size_t number_of_zoom_levels = sizeof(zoom_levels) / sizeof(zoom_levels[0]);
|
||||
|
||||
static constexpr size_t initial_zoom_level = 8;
|
||||
|
||||
class PDFViewer : public GUI::AbstractScrollableWidget {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue