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

saving integer as integer, keeping all other formats as string #66

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

samarthjuneja24
Copy link

No description provided.

@samarthjuneja24
Copy link
Author

Resolves #3

Comment on lines +70 to +77
valueInt, valueIntOrErr := strconv.ParseInt(value, 10, 64)

// putting the k and value in a Hash Table
Put(key, NewObj(value, exDurationMs, oType, oEnc))
if valueIntOrErr == nil {
Put(key, NewObj(valueInt, exDurationMs, oType, oEnc))
} else {
Put(key, NewObj(value, exDurationMs, oType, oEnc))
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we not check this while we are deducing the type and encoding? Doing strconv again is inefficient.

Copy link
Author

Choose a reason for hiding this comment

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

Would have to make the deduce encoding method more specific for int64 usecases. It will have to return 4 params then instead of the existing two. One with the integer value and the other the err value of parseInt. And this will start bloating when more data types are added

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.

None yet

2 participants