Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Orekit
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Gaëtan Pierre
Orekit
Commits
8119bfff
Commit
8119bfff
authored
3 years ago
by
Luc Maisonobe
Browse files
Options
Downloads
Patches
Plain Diff
Fixed copy errors when using dictionary views.
parent
ea1dd7f1
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/org/orekit/utils/DoubleArrayDictionary.java
+4
-2
4 additions, 2 deletions
src/main/java/org/orekit/utils/DoubleArrayDictionary.java
src/main/java/org/orekit/utils/FieldArrayDictionary.java
+4
-2
4 additions, 2 deletions
src/main/java/org/orekit/utils/FieldArrayDictionary.java
with
8 additions
and
4 deletions
src/main/java/org/orekit/utils/DoubleArrayDictionary.java
+
4
−
2
View file @
8119bfff
...
...
@@ -63,8 +63,10 @@ public class DoubleArrayDictionary implements Serializable {
* @param dictionary dictionary to use for initializing entries
*/
public
DoubleArrayDictionary
(
final
DoubleArrayDictionary
dictionary
)
{
this
(
DEFAULT_INITIAL_CAPACITY
+
dictionary
.
data
.
size
());
for
(
final
Entry
entry
:
dictionary
.
data
)
{
// take care to call dictionary.getData() and not use dictionary.data,
// otherwise we get an empty dictionary when using a DoubleArrayDictionary.view
this
(
DEFAULT_INITIAL_CAPACITY
+
dictionary
.
getData
().
size
());
for
(
final
Entry
entry
:
dictionary
.
getData
())
{
// we don't call put(key, value) to avoid the overhead of the unneeded call to remove(key)
data
.
add
(
new
Entry
(
entry
.
getKey
(),
entry
.
getValue
()));
}
...
...
This diff is collapsed.
Click to expand it.
src/main/java/org/orekit/utils/FieldArrayDictionary.java
+
4
−
2
View file @
8119bfff
...
...
@@ -70,8 +70,10 @@ public class FieldArrayDictionary<T extends CalculusFieldElement<T>> {
* @param dictionary dictionary to use for initializing entries
*/
public
FieldArrayDictionary
(
final
FieldArrayDictionary
<
T
>
dictionary
)
{
this
(
dictionary
.
getField
(),
DEFAULT_INITIAL_CAPACITY
+
dictionary
.
data
.
size
());
for
(
final
Entry
entry
:
dictionary
.
data
)
{
// take care to call dictionary.getData() and not use dictionary.data,
// otherwise we get an empty dictionary when using a FieldArrayDictionary.view
this
(
dictionary
.
getField
(),
DEFAULT_INITIAL_CAPACITY
+
dictionary
.
getData
().
size
());
for
(
final
Entry
entry
:
dictionary
.
getData
())
{
// we don't call put(key, value) to avoid the overhead of the unneeded call to remove(key)
data
.
add
(
new
Entry
(
entry
.
getKey
(),
entry
.
getValue
()));
}
...
...
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