Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simple refactor, typo fixes, added logger #639

Merged
merged 9 commits into from
Jul 13, 2023

Conversation

konketf
Copy link
Contributor

@konketf konketf commented Jul 12, 2023

No description provided.

@welcome
Copy link

welcome bot commented Jul 12, 2023

Thanks so much for opening this pull request and for helping to improve SirixDB 🚀

@@ -151,7 +164,7 @@ public void remove() {
private static int defaultCapacity = 16;

/**
* Holds the base hash entries. if the capacity is 2^N, than the base hash
* Holds the base hash entries. if the capacity is 2^N, thn the base hash

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sill minor typo: I guess it's "then" ;-)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two times the charm :')

@@ -619,7 +634,7 @@ public boolean equals(Object o) {

T v1 = this.get(key);
T v2 = that.get(key);
if ((v1 == null && v2 != null) || (v1 != null && v2 == null) || (!v1.equals(v2))) {
if ((v1 == null && v2 != null) || (v1 != null && v2 == null) || (v1!= null && !v1.equals(v2))) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we also may be able to use if (!Object.equals(v1, v2)) { return false };, but I'd have to check the implementation ;-)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or simply return Objects.equals(v1, v2);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll keep that in mind

Aminmalek

This comment was marked as duplicate.

@@ -329,8 +329,7 @@ public boolean containsKey(int key) {
* false otherwise.
*/
public boolean containsValue(Object o) {
for (Iterator<T> iterator = iterator(); iterator.hasNext(); ) {
T object = iterator.next();
for (T object : this) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can explain why you used enhanced for-loop in this situation?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No other reason than just making it more compact

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Though I can see it being an issue for some people if I'm being honest

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's great :-)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you

@@ -301,7 +314,7 @@ public void clear() {
// And setting all the <code>next[i]</code> to point at
// <code>i+1</code>.
for (int i = 1; i < this.capacity; ) {
next[i] = ++i;
next[i] = i + 1;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is wrong, as it doesn't increment i anymore.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What am I not seeing?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh the increment isn't even present in the method

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gonna keep an eye out for silly mistakes

@JohannesLichtenberger JohannesLichtenberger merged commit d37cf11 into sirixdb:master Jul 13, 2023
2 checks passed
@welcome
Copy link

welcome bot commented Jul 13, 2023

Congrats on merging your first pull request. 🐬 You've just improved SirixDB for everyone. ❤️

@JohannesLichtenberger
Copy link
Member

@shdowtail thanks for your contributions so far. Hope you'll be able to deep dive into the code base and keep on contributing :-)

The sirix-* images in https://github.com/sirixdb/sirixdb.github.io/tree/master/images describe various parts of the system. Maybe it's already of some use, but I'll write a new technical doc about the architecture, using these images :-)

@konketf
Copy link
Contributor Author

konketf commented Jul 15, 2023

@shdowtail thanks for your contributions so far. Hope you'll be able to deep dive into the code base and keep on contributing :-)

The sirix-* images in https://github.com/sirixdb/sirixdb.github.io/tree/master/images describe various parts of the system. Maybe it's already of some use, but I'll write a new technical doc about the architecture, using these images :-)

I certainly will. Currently taking a course to refresh my mind of few things though

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants