Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
JuK
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Multimedia
JuK
Commits
33e19d67
Commit
33e19d67
authored
Mar 09, 2003
by
Scott Wheeler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CVS_SILENT more cleanups from my silly variable renamer script
svn path=/trunk/kdemultimedia/juk/; revision=212469
parent
f6da7f7a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
14 deletions
+14
-14
stringhash.cpp
stringhash.cpp
+11
-11
stringhash.h
stringhash.h
+3
-3
No files found.
stringhash.cpp
View file @
33e19d67
...
...
@@ -19,14 +19,14 @@
static
const
int
tableSize
=
5003
;
class
StringHash
::
m_
Node
class
StringHash
::
Node
{
public:
m_
Node
(
const
QString
&
value
)
:
key
(
value
),
next
(
0
)
{}
~
m_
Node
()
{}
Node
(
const
QString
&
value
)
:
key
(
value
),
next
(
0
)
{}
~
Node
()
{}
QString
key
;
m_
Node
*
next
;
Node
*
next
;
};
StringHash
::
StringHash
()
:
m_table
(
tableSize
)
...
...
@@ -43,8 +43,8 @@ StringHash::~StringHash()
bool
StringHash
::
insert
(
const
QString
&
value
)
{
int
h
=
hash
(
value
);
m_
Node
*
i
=
m_table
[
h
];
m_
Node
*
j
=
0
;
Node
*
i
=
m_table
[
h
];
Node
*
j
=
0
;
while
(
i
)
{
if
(
i
->
key
==
value
)
...
...
@@ -56,9 +56,9 @@ bool StringHash::insert(const QString &value)
}
if
(
j
)
j
->
next
=
new
m_
Node
(
value
);
j
->
next
=
new
Node
(
value
);
else
m_table
.
insert
(
h
,
new
m_
Node
(
value
));
m_table
.
insert
(
h
,
new
Node
(
value
));
return
false
;
}
...
...
@@ -66,7 +66,7 @@ bool StringHash::insert(const QString &value)
bool
StringHash
::
contains
(
const
QString
&
value
)
const
{
int
h
=
hash
(
value
);
m_
Node
*
i
=
m_table
[
h
];
Node
*
i
=
m_table
[
h
];
while
(
i
&&
i
->
key
!=
value
)
i
=
i
->
next
;
...
...
@@ -79,7 +79,7 @@ QStringList StringHash::values() const
{
QStringList l;
m_
Node *n;
Node *n;
for(int i = 0; i < tableSize; i++) {
n = m_table[i];
...
...
@@ -119,7 +119,7 @@ int StringHash::hash(const QString &key) const
return
index
%
tableSize
;
}
void
StringHash
::
deleteNode
(
m_
Node
*
n
)
void
StringHash
::
deleteNode
(
Node
*
n
)
{
if
(
n
)
{
deleteNode
(
n
->
next
);
...
...
stringhash.h
View file @
33e19d67
...
...
@@ -39,11 +39,11 @@ public:
// QStringList values() const;
private:
class
m_
Node
;
class
Node
;
int
hash
(
const
QString
&
key
)
const
;
void
deleteNode
(
m_
Node
*
n
);
void
deleteNode
(
Node
*
n
);
QPtrVector
<
m_
Node
>
m_table
;
QPtrVector
<
Node
>
m_table
;
};
#endif
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment