arehbein has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/libosmocore/+/31591 )


Change subject: osmo_wqueue_enqueue(): Avoid redundant if-check
......................................................................

osmo_wqueue_enqueue(): Avoid redundant if-check

Remove call to osmo_wqueue_enqueue_quiet(), which checks the same condition as 
osmo_wqueue_enqueue.
The result is basically one function less on the call stack and one
if-check less; while having one more statement in osmo_wqueue_enqueue() itself 
compared to before.

Change-Id: I3ecc1698e836ca40e178a5b84c2946ae0e6bbfc9
---
M src/core/write_queue.c
1 file changed, 17 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/91/31591/1

diff --git a/src/core/write_queue.c b/src/core/write_queue.c
index 884cebd..b5cbe6d 100644
--- a/src/core/write_queue.c
+++ b/src/core/write_queue.c
@@ -128,7 +128,10 @@
                return -ENOSPC;
        }

-       return osmo_wqueue_enqueue_quiet(queue, data);
+       msgb_enqueue_count(&queue->msg_queue, data, &queue->current_length);
+       queue->bfd.when |= OSMO_FD_WRITE;
+
+       return 0;
 }

 /*! Clear a \ref osmo_wqueue

--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/31591
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I3ecc1698e836ca40e178a5b84c2946ae0e6bbfc9
Gerrit-Change-Number: 31591
Gerrit-PatchSet: 1
Gerrit-Owner: arehbein <[email protected]>
Gerrit-MessageType: newchange

Reply via email to