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

Fixed issue HB_SCAN for LOGICAL value #363

Merged
merged 1 commit into from
Dec 3, 2024
Merged

Conversation

lailton
Copy link
Contributor

@lailton lailton commented Dec 3, 2024

2024-12-03 01:27 UTC-0300 Lailton Fernando Mariano (lailton/at/paysoft.com.br)

  • src/vm/hashfunc.c
    ! fixed issue hb_scan when we are looking for a logical value as true.
    Many thanks to Marcos Gambeta who found the problem.

Here an example reproduce the issue.

function main()

	LOCAL hHash := { "key1" => .T., "key2" => .F., "key3" => .T. }
	LOCAL lSearchValue := .T. // Logical value to search
	LOCAL nFoundIndex
	
	? "Hash table:", hHash
	? "Searching for:", lSearchValue
	
	
	// Use HB_HSCAN to find the logical value
	nFoundIndex := HB_HSCAN(hHash, lSearchValue)
	
	IF nFoundIndex > 0
		? "Logical value found at index:", nFoundIndex
	ELSE
		? "Logical value not found!"
	ENDIF

return nil

Expected result is return position 1.

More info:
Harbour Developers - Group

…t.com.br)

  * src/vm/hashfunc.c
    ! fixed issue hb_scan when we are looking for a logical value as true.
      Many thanks to Marcos Gambeta who found the problem.
@FiveTechSoft
Copy link
Member

thank you

@FiveTechSoft FiveTechSoft merged commit 93d6749 into harbour:master Dec 3, 2024
17 of 26 checks passed
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.

2 participants