Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
Game Library
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Onuralp SEZER
Game Library
Commits
c8c02769
Commit
c8c02769
authored
2 years ago
by
Joseph Walton-Rivers
Browse files
Options
Downloads
Patches
Plain Diff
remove unused header
parent
f0d36f5a
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
include/fggl/ecs3/utils.hpp
+0
-50
0 additions, 50 deletions
include/fggl/ecs3/utils.hpp
with
0 additions
and
50 deletions
include/fggl/ecs3/utils.hpp
deleted
100644 → 0
+
0
−
50
View file @
f0d36f5a
/*
* This file is part of FGGL.
*
* FGGL is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
* later version.
*
* FGGL is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along with FGGL.
* If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef FGGL_ECS3_UTILS_HPP
#define FGGL_ECS3_UTILS_HPP
#include
<cstddef>
namespace
fggl
::
utils
{
template
<
typename
T
>
std
::
size_t
search
(
const
T
*
data
,
const
std
::
size_t
size
,
const
T
&
v
)
{
// empty list == not found
if
(
size
==
0
)
{
return
size
;
}
std
::
size_t
left
=
0
;
std
::
size_t
right
=
size
-
1
;
while
(
left
<=
right
)
{
std
::
size_t
m
=
(
left
+
right
)
/
2
;
if
(
data
[
m
]
==
v
)
{
return
m
;
}
else
if
(
v
<
data
[
m
])
{
if
(
m
==
0
)
{
return
size
;
}
right
=
m
-
1
;
}
else
{
left
=
m
+
1
;
}
}
return
size
;
}
}
#endif
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment